解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String str=sc.next(); char ch[]=str.toCharArray(); for (int i = 0; i < ch.length; i++) { if ((int)ch[i]>=65&&(int)ch[i]<=90) { ch[i]=(char)((int)ch[i]+32); System.out.print(ch[i]); } else if ((int)ch[i]>=97&&(int)ch[i]<=122) { ch[i]=(char)((int)ch[i]-32); System.out.print(ch[i]); } } } }
0.0分
1 人评分
C语言程序设计教程(第三版)课后习题8.5 (C语言代码)浏览:535 |
【蟠桃记】 (C语言代码)浏览:664 |
C语言程序设计教程(第三版)课后习题8.7 (C语言代码)浏览:594 |
C语言程序设计教程(第三版)课后习题11.3 (C语言代码)浏览:564 |
图形输出 (C语言代码)浏览:937 |
格式化数据输出 (C语言代码)浏览:811 |
整除问题 (C语言代码)浏览:518 |
敲七 (C语言代码)浏览:2699 |
上车人数 (C语言代码)浏览:710 |
整除的尾数 (C语言代码)浏览:809 |