【算法】程序猿不写代码是不对的67
来源:互联网 发布:网络剪刀手 win7 编辑:程序博客网 时间:2024/06/05 00:25
package com.kingdz.algorithm.time201706;/** * <pre> * 出错的打字员 * 假设打字员在打字的时候出现了错误,所有的字母都以键盘的位置向右移动了一位 * 根据打字的输出结果输入打字员实际希望打出的句子 * 在这个程序中不考虑越界的情况 * </pre> * * @author kingdz * */public class Algo07 { static String str = "`1234567890-=qwertyuiop[]\\asdfghjkl;'zxcvbnm,./"; public static void main(String[] args) { char[] charArray = str.toCharArray(); String input = "o s, gomr ypfsu/"; StringBuilder strb = new StringBuilder(); for (char c : input.toCharArray()) { if (c == ' ') { strb.append(" "); } else { for (int i = 0; i < charArray.length; i++) { if (c == charArray[i]) { strb.append("" + charArray[i - 1]); break; } } } } System.out.println(strb.toString()); }}
阅读全文
0 0
- 【算法】程序猿不写代码是不对的67
- 【算法】程序猿不写代码是不对的1
- 【算法】程序猿不写代码是不对的2
- 【算法】程序猿不写代码是不对的3
- 【算法】程序猿不写代码是不对的4
- 【算法】程序猿不写代码是不对的5
- 【算法】程序猿不写代码是不对的6
- 【算法】程序猿不写代码是不对的7
- 【算法】程序猿不写代码是不对的8
- 【算法】程序猿不写代码是不对的9
- 【算法】程序猿不写代码是不对的10
- 【算法】程序猿不写代码是不对的11
- 【算法】程序猿不写代码是不对的12
- 【算法】程序猿不写代码是不对的13
- 【算法】程序猿不写代码是不对的14
- 【算法】程序猿不写代码是不对的15
- 【算法】程序猿不写代码是不对的16
- 【算法】程序猿不写代码是不对的17
- winpe下开启vs远调器
- 剑指offer:第29题寻找数组中出现次数超过一半的数字
- 混合开发,原生+html5
- 异常—Cause: java.sql.SQLException: Data source is closed
- POJ
- 【算法】程序猿不写代码是不对的67
- OpenJ_Bailian
- 2017年6月7日头条争夺战:微信公众号居然公然和高考抢头条?!
- Ubuntu14.04下OpenCV安装
- #QGIS源码官方编译指南
- 解决Caffe训练过程中loss不变问题
- 注释驱动的 Spring cache 缓存介绍
- coding之后端经验
- 判别是否包含了emojicon表情