NYOJ题目457大小写互换

-------------------------------

AC代码:


 1 import java.util.Scanner;
 2 
 3 public class Main {
 4 
 5     public static void main(String[] args) {
 6         
 7         
 8         
 9         Scanner sc=new Scanner(System.in);
10         
11         int n=Integer.parseInt(sc.nextLine());
12         
13         while(n-->0){
14             
15             char cs[]=sc.nextLine().toCharArray();
16             
17             for(int i=0;i<cs.length;i++){
18                 if(cs[i]>='a' && cs[i]<='z') cs[i]-=32;
19                 else cs[i]+=32;
20             }
21             
22             System.out.println(new String(cs));
23             
24         }
25         
26     }
27     
28 }

题目来源: http://acm.nyist.net/JudgeOnline/problem.php?pid=457

相关文章:

  • 2021-11-16
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2022-02-27
  • 2021-08-04
  • 2021-12-03
猜你喜欢
  • 2021-12-11
  • 2021-05-31
  • 2021-09-24
  • 2022-01-13
  • 2021-07-06
  • 2021-08-04
相关资源
相似解决方案