cAPS lOCK

Time Limit:500MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u

Description

wHAT DO WE NEED cAPS LOCK FOR?

Caps lock is a computer keyboard key. Pressing it sets an input mode in which typed letters are capital by default. If it is pressed by accident, it leads to accidents like the one we had in the first passage.

Let's consider that a word has been typed with the Caps lock key accidentally switched on, if:

  • either it only contains uppercase letters;
  • or all letters except for the first one are uppercase.

In this case we should automatically change the case of all letters. For example, the case of the letters that form words "hELLO", "HTTP", "z" should be changed.

Write a program that applies the rule mentioned above. If the rule cannot be applied, the program should leave the word unchanged.

Input

The first line of the input data contains a word consisting of uppercase and lowercase Latin letters. The word's length is from 1 to 100 characters, inclusive.

Output

Print the result of the given word's processing.

Sample Input

Input
cAPS
Output
Caps
Input
Lock
Output
Lock
 #include <stdio.h>
#include <string.h>
int main()
{
char a[];
int i,j,k;
while(scanf("%s",a)!=EOF)
{
int flg=;
int l=strlen(a);
for(i=;i<l;i++)
{
if('A'<=a[i] && a[i]<='Z')
k=;
else
{
flg=;
break;
}
}
//printf("%d\n",flg);
if(flg!=)
printf("%s\n",a);
else
{
if('A'<=a[] && a[]<='Z')
printf("%c",a[]+);
else
printf("%c",a[]-);
for(i=;i<l;i++)
printf("%c",a[i]+);
}
printf("\n");
}
return ;
}

CodeForces 131A cAPS lOCK的更多相关文章

  1. ubunut 14.04 将Caps Lock设置为Control

    入手了emacs,一直折腾想把caps Lock设置为control键. 网上看到一个用gnome里找到系统-首选项之类可以直接设置的.在14.04版的ub中是找不到的(新版设置太坑,只有那么几个选项 ...

  2. ubuntu 交换ctrl与caps lock 键

    The relevant option is no longer available in the settings menu in Ubuntu 13.10; this has been repor ...

  3. 交换Ctrl和Caps Lock键

    由于使用vim的缘故,就把Ctrl和Caps Lock键交换了,在ubuntu系统下使用系统设置可以很简单地进行全局替换. 在ubuntu下习惯了之后在window下就经常按错...后来决定也把win ...

  4. 转:判断Caps Lock键是否打开,如果打开则关闭

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  5. Mac下常用按键符号⌘(command)、⌥(option)、⇧(shift)、⇪(caps lock)、⌃(control)、↩(return)、⌅(enter)

    常用符号如下: ⌘(command) ⌥(option) ⇧(shift) ⇪(caps lock) ⌃(control) ↩(return) ⌅(enter) 对应键盘的位置如下: 如果每次都不记得 ...

  6. Mac OS 10.12后Caps lock(大写键)无法使用的解决办法

    ▲打开设置中的键盘选项,并切换至输入源选项标签, ▲取消勾选“使用大写锁定键来回切换“美国英文””, ▲这时再按下Caps lock即可正常使用大小写切换. ▲Update:目前macOS 10.12 ...

  7. C - cAPS lOCK

    Problem description wHAT DO WE NEED cAPS LOCK FOR? Caps lock is a computer keyboard key. Pressing it ...

  8. OSX - Mac OS 10.12后Caps lock(大写键)无法使用的解决办法

    我在OSX的虚拟机中安装了windows 7 操作系统,但是发现在win7下,大写键不起作用,通过下面方面搞定了! ▲打开设置中的键盘选项,并切换至输入源选项标签, ▲取消勾选“使用大写锁定键来回切换 ...

  9. codeforces水题100道 第二十六题 Codeforces Beta Round #95 (Div. 2) A. cAPS lOCK (strings)

    题目链接:http://www.codeforces.com/problemset/problem/131/A题意:字符串大小写转换.C++代码: #include <cstdio> #i ...

随机推荐

  1. 夺命雷公狗---node.js---17之项目的构建在node+express+mongo的博客项目2之一,二级路由

    然后我们就来开始搭建后台了... 不过后台我们可以来玩玩他的二级路由... 然后再去修改下他们的样式即可......修改方法和刚才那里的修改方法一样, 访问效果如下所示: OK,已经正常相识了

  2. Android相对布局实例

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools= ...

  3. android拨打电话

    1.要使用Android系统中的电话拨号功能,首先必须在AndroidManifest.xml功能清单中加入允许拨打电话的权限: <uses-permission android:name=&q ...

  4. 160826、浏览器渲染页面过程描述,DOM编程技巧以及重排和重绘

    一.浏览器渲染页过程描述   1.浏览器解析html源码,然后创建一个DOM树. 在DOM树中,每一个HTML标签都有一个对应的节点(元素节点),并且每一个文本也都有一个对应的节点(文本节点). DO ...

  5. scala的继承

    package com.test.scala.test /** * 模拟java的继承,扩展类 */ abstract class ExtendClass(val des:String) { def ...

  6. 如何查看Linux操作系统版本

    1. 查看内核版本命令: 360kb.com:~> cat /proc/version Linux version 2.6.32-358.el6.x86_64 (mockbuild@c6b8.b ...

  7. oracle sql获取随机数

    SQL> select round(dbms_random.value(10000,99999)) num from dual;

  8. MYSQL的主从和主主复制模式

    一.复制介绍 MySQL支持单向.异步复制,复制过程中一个服务器充当主服务器,而一个或多个其它服务器充当从服务器.主服务器将更新写入二进制日志文件,并维护文件的一个索引以跟踪日志循环.这些日志可以记录 ...

  9. css不同浏览器兼容性调试 --- 转自: [http://wo.115.com/?ct=detail&id=31733&bid=1018841]

    css不同浏览器兼容性调试 IE6.0,IE7.0与Firefox的CSS兼容性问题1.DOCTYPE 影响 CSS 处理 2.FF: div 设置 margin-left, margin-right ...

  10. java中MD5加密的小使用

    最近项目中需要用到md5加密,就自己在网上看了看. package com.wxgs.ch01; import java.security.MessageDigest; import java.sec ...