131A
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#define MAXSIZE 105
int main()
{
char str[MAXSIZE];
scanf("%s", str);
int length=strlen(str);
int up_n=0,lo_n=0;
int i;
for(i=0; i<length; ++i)
{
if((str[i]>='a')&&(str[i]<='z'))
++lo_n;
else
++up_n;
}
bool flag=false;
if((str[0]>='a')&&(str[0]<='z'))
{
if(up_n==(length-1))
flag=true;
}
else if(up_n==length)
flag=true;
if(flag)
for(i=0; i<length; ++i)
{
if((str[i]>='a')&&(str[i]<='z'))
printf("%c", str[i]-32);
else
printf("%c", str[i]+32);
}
else
for(i=0; i<length; ++i)
printf("%c",str[i]);
printf("\n");
return 0;
}
131A的更多相关文章
- CodeForces 131A cAPS lOCK
cAPS lOCK Time Limit:500MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit St ...
- python学习(解析python官网会议安排)
在学习python的过程中,做练习,解析https://www.python.org/events/python-events/ HTML文件,输出Python官网发布的会议时间.名称和地点. 对ht ...
- 设备管理 USB ID
发现个USB ID站点,对于做设备管理识别的小伙伴特别实用 http://www.linux-usb.org/usb.ids 附录: # # List of USB ID's # # Maintain ...
- Codeforces初体验
Codeforces印象 这两天抽时间去codeforces体验了一把. 首先,果然有众多大牛存在.非常多名人一直參加每周一次的比赛.积分2000+,并參与出题. 另外.上面题目非常多.预计至少一千题 ...
随机推荐
- Source Insight小技巧:修改Symbol Window的默认宽度
SI是个好东西,但是源代码窗口左边的符号窗口的默认宽度实在是太小,每次打开一个新的源码窗口都要重新拖放调整,很烦人.下面是一劳永逸调整Symbol Window宽度的方法. 打开一个源码窗口,将Sym ...
- 【Unity】通用的Debugger日志模块
模块代码整理自 http://gad.qq.com/lore/catalog/10007 Debugger类.提供打印日志的静态方法. using System; using System.IO; n ...
- python 操作Sqlite
Python sqlite 官方文档: https://docs.python.org/2/library/sqlite3.html 1. 连接 #!/usr/bin/python3 import s ...
- sping加载bean都发生了些什么
问题描述:使用@Autowired注入的类,没有实例化 //Controller @RequestMapping(value="/deepblue") @Controller pu ...
- JAVA—API和SPI概念
JAVA—API和SPI概念 目录 概念 JDBC实例 自己实现一个SPI 总结 概念英文: What is the difference between Service Provider Inter ...
- 2. ansible-playbook 条件语句-内部变量使用
内部变量指的是把变量定义在playbook里面或者是执行结果作为变量 循环语句-标准Loops [root@LeoDevops playb]# cat p_loop.yaml - hosts: u12 ...
- SQL in、not in、exists和not exists的区别:
来自:http://blog.sina.com.cn/s/blog_8a0c4f130100zaw2.html 先谈谈in和exists的区别: exists:存在,后面一般都是子查询,当子查询返回行 ...
- xdebug php 运行效率分析工具
Xdebug是一个开放源代码的PHP程序调试器(即一个Debug工具),可以用来跟踪,调试和分析PHP程序的运行状况. 官网:https://xdebug.org/index.php 安装方法: ht ...
- centos 7 IP不能访问nginx Failed connect to 185.239.226.111:80; No route to host解决办法
服务器环境 centos 7.4 问题描述 1.可以ping通IP ,用IP访问nginx 不能访问,在服务器上curl localhost curl 185.239.226.111可以获得 [ro ...
- [原]CentOS7安装Rancher2.1并部署kubernetes (三)---解决登录kubernets超时和部署测试Pod和Containter[nginx为例]
################## Rancher v2.1.7 + Kubernetes 1.13.4 ################ ##################### ...