【九度OJ】1021【模拟】
2014-08-19 00:46
337 查看
代码:
package Test1; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Test33_1021 { /** * by qr jobdu 1021 2014-8-19 * @throws IOException */ public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str1,str2; int len1,len2; while(true){ str1=br.readLine(); if(str1.equals("#")) break; str2=br.readLine(); len1=str1.length(); len2=str2.length(); int num[]=new int[len1]; for(int i=0;i<len2;i++){ char temp2=str2.charAt(i); for(int j=0;j<len1;j++){ char temp1=str1.charAt(j); if(temp1==temp2) num[j]++; } } for(int i=0;i<len1;i++) System.out.println(str1.charAt(i)+" "+num[i]); } } }
相关文章推荐
- 九度OJ 1021 统计字符 (模拟)
- 九度OJ 1064 反序数 (模拟)
- 【九度OJ】1015【模拟】【A+B系列2006】
- 九度OJ 1147:Jugs(罐子) (模拟、游戏)
- 【九度OJ】1022【模拟】
- 九度OJ 1402(计数) 1403(模拟) 1404(未完成) 1405(未完成) 1406(最短路)
- 九度OJ 1147:Jugs(罐子) (模拟、游戏)
- 九度OJ 1334:占座位 (模拟)
- 九度OJ 1363 欢乐斗地主 (模拟,细心)
- 九度OJ 1355:扑克牌顺子 (模拟)
- 九度OJ 1334:占座位 (模拟)
- 九度OJ 1355:扑克牌顺子 (模拟)
- 九度oj 1021
- 九度oj 题目1021:统计字符 【ZJU2007考研机试题2】
- 九度OJ 1179 阶乘(模拟)
- 【九度OJ】1060【模拟】【C实现】【清华2000】
- 九度OJ 1068 球半径和数量 (模拟)
- 九度OJ 1183 守形数 (模拟)
- 九度 OJ 1021:统计字符
- 【九度OJ】1031【模拟】【C实现】【浙大2009】