参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String email = scanner.nextLine(); int n = scanner.nextInt(); String [][]form = new String[n][3]; int cnt = 0; for(int i = 0; i < n; i++) { form[i][0] = scanner.next(); form[i][1] = scanner.next(); form[i][2] = scanner.next(); if(form[i][2].equals(email)) { cnt++; System.out.print(form[i][0] + " "); String res = ""; for(char c: form[i][1].toCharArray()) { if(Character.isLowerCase(c)) c = Character.toUpperCase(c); else if(Character.isUpperCase(c)) c = Character.toLowerCase(c); res += c; } System.out.println(res); } } if(cnt == 0) System.out.println("empty"); } }
0.0分
4 人评分
计算质因子 (C++代码)浏览:1824 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:821 |
2005年春浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:637 |
【矩阵】 (C++代码)浏览:999 |
简单的a+b (C语言代码)浏览:626 |
矩阵加法 (C语言代码)浏览:1768 |
1012题解浏览:938 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:585 |
DNA (C语言代码)浏览:440 |
C语言训练-亲密数 (C语言描述,反正怎么都能对)浏览:2256 |