#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的更多相关文章

  1. CodeForces 131A cAPS lOCK

    cAPS lOCK Time Limit:500MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit St ...

  2. python学习(解析python官网会议安排)

    在学习python的过程中,做练习,解析https://www.python.org/events/python-events/ HTML文件,输出Python官网发布的会议时间.名称和地点. 对ht ...

  3. 设备管理 USB ID

    发现个USB ID站点,对于做设备管理识别的小伙伴特别实用 http://www.linux-usb.org/usb.ids 附录: # # List of USB ID's # # Maintain ...

  4. Codeforces初体验

    Codeforces印象 这两天抽时间去codeforces体验了一把. 首先,果然有众多大牛存在.非常多名人一直參加每周一次的比赛.积分2000+,并參与出题. 另外.上面题目非常多.预计至少一千题 ...

随机推荐

  1. Python中的__name__和类

    1.   python中if __name__ == '__main__': 的解析 经常会在代码的最下面看到if __name__ == '__main__':,现在就来介 绍一下它的作用. 模块是 ...

  2. crawler_exa2

    优化中... #! /usr/bin/env python # -*- coding:utf-8 -*- # Author: Tdcqma ''' v17.0920.1401 基本功能实现,漏洞标题与 ...

  3. ph 提交代码的步骤;

    ph 提交代码的步骤: git status 查看状态: ls -ah 查看文件: git stash list 查看本地缓存的文件: git branch 查看本地的分支: git checkout ...

  4. sql查父节点小笔记

    )) ),sortNum int) as BEGIN DECLARE @sortNum int --得到当前id的父id, select @id = ParentId, @sortNum =Sortn ...

  5. 框架源码系列九:依赖注入DI、三种Bean配置方式的注册和实例化过程

    一.依赖注入DI 学习目标1)搞清楚构造参数依赖注入的过程及类2)搞清楚注解方式的属性依赖注入在哪里完成的.学习思路1)思考我们手写时是如何做的2)读 spring 源码对比看它的实现3)Spring ...

  6. [原创]Cadence Allegro小技巧之解决Out of date shapes问题

    Allegro报错“Dynamic shapes are out of date; please update them. Check for out of date shapes in Setup ...

  7. Linux 文件系统剖析

    [转自]https://www.ibm.com/developerworks/cn/linux/l-linux-filesystem/ 按照分层结构讨论 Linux 文件系统 在文件系统方面,Linu ...

  8. 一、K3 WISE 开发插件《K3 WISE常用数据表整理》

    在后台数据库ICClassType表中,字段FID<0的是老单,FID>0的是新单. ----------------系统设置------------------------FStatus ...

  9. 如何使用LinkedHashMap来实现一个LruCache

    最近在看mybatis的源代码,发现了mybatis中实现的LruCache使用到了LinkedHashMap,所以就探究了一下LinkedHashMap是如何支持Lru缓存的 LinkedHashM ...

  10. RecyclerView实现分组展示信息

    extends:http://blog.csdn.net/wzlyd1/article/details/52292548 前言 一直在鸿洋大神的安卓群里水群,渐渐的loader和安卓弟等人都成长了起来 ...