您的位置:首页 > 理论基础 > 计算机网络

【2015ZUFE新生赛网络同步赛B】【水题】秘密改动 大小写变换

2015-12-07 12:15 465 查看
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<ctype.h>
#include<math.h>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<bitset>
#include<algorithm>
#include<time.h>
using namespace std;
void fre(){freopen("c://test//input.in","r",stdin);freopen("c://test//output.out","w",stdout);}
#define MS(x,y) memset(x,y,sizeof(x))
#define MC(x,y) memcpy(x,y,sizeof(x))
#define MP(x,y) make_pair(x,y)
#define ls o<<1
#define rs o<<1|1
typedef long long LL;
typedef unsigned long long UL;
typedef unsigned int UI;
template <class T1,class T2>inline void gmax(T1 &a,T2 b){if(b>a)a=b;}
template <class T1,class T2>inline void gmin(T1 &a,T2 b){if(b<a)a=b;}
const int N=0,M=0,Z=1e9+7,ms63=1061109567;
int casenum,casei;
char s[10010];
int main()
{
while(~scanf("%s",s))
{
for(int i=0;s[i];++i)
{
if(i%2==0)s[i]=tolower(s[i]);
else s[i]=toupper(s[i]);
}
puts(s);
}
return 0;
}
/*
【题意】
给你一个串,让你把奇数位置变成小写,偶数位置变成大写,并输出这个串。

【类型】
水题

*/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  水题