字符串大小写逆置(神奇的ascll码)
来源:互联网 发布:数据部门团建出行标语 编辑:程序博客网 时间:2024/06/05 09:50
自己写的第一个稍微按要求来的程序
描述:
给定一个字符串,全部由英文字母组成 ,要求把该字符串的中的大写字母改为小写,小写字母改为大写。字符长度不超过20
Input a string, it is compose of letters, you must be change all the uppercase letters to lowercase and all the lowercase to uppercase. The string length is no more then 20
输入:
一个长度不超过20的字符串
Input a string, the string length is no more then 20
输出:
输出处理完后的字符串,最后输出回车
Output the reversed string.
输入样例:
HelloWorld
输出样例:
hELLOwORLD
//1034字符串大小写逆置#include<iostream>#include<cstdio>
using namespace std;
int main(){ int i,j; char A[21]; gets(A); for(i=0;i<20;i++) { if(A[i]=='\0')//限制范围 { j=i; break; } } for(i=0;i<j;i++)//逆置大小写 { if(A[i]>=65&&A[i]<=90) { A[i]+=32; } else if(A[i]>=97&&A[i]<=122) { A[i]-=32; } } puts(A); return 0; }
- 字符串大小写逆置(神奇的ascll码)
- 键盘的ASCll码
- 字符串大小写逆置
- 字符串大小写逆置
- 【1034】字符串大小写逆置
- ASCLL码
- ASCLL码
- 从字符串找到ASCLL码最大的数,并移到最前面
- JAVA 接收键盘输入的字符串,转换成数组,输出ASCLL
- 神奇的字符串
- ZUFE2481 神奇的字符串
- 判断字符串的大小写
- 字符串的大小写转换
- ASCll码对照表
- 一些ASCLL码
- NYOJ - ASCLL码排序
- 初遇ASCLL码
- ASCLL码排序
- ip 命令 和ifconfig 命令 删除IP
- Python与数据库简单交互
- Java环境变量配置
- Oracle数据库常用命令
- usaco(集合,水题但比较新颖)
- 字符串大小写逆置(神奇的ascll码)
- Unity试题整理(1)
- LINUX 下监听文件过多出现报错Error:watch ENOSPC
- 1003. 我要通过!(20)
- laravel
- 三段式状态机的写法总结
- java练习题4
- 分割符和定长解码
- SPOJ10606 BALNUM