首页 > 其他 > 详细

NYOJ题目457大小写互换

时间:2016-08-27 15:18:15      阅读:173      评论:0      收藏:0      [点我收藏+]

技术分享

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

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

NYOJ题目457大小写互换

原文:http://www.cnblogs.com/cc11001100/p/5812960.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!