标签:des style color os strong io for art
input |
---|
(We) [are] {blind}, if (we) [could not see] {creation of this clone army} |
output |
Blind we are, if creation of this clone army we could not see |
input |
{Truly wonderful} (the mind of a child) [is] |
output |
Truly wonderful the mind of a child is |
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<limits.h> using namespace std; char s[1100]; char a[3][110]; int main() { while(gets(s)) { int len=strlen(s); int t=0; int r=0; for(int i=0;i<len;i++) { if(s[i]=='(') { int l=0; for(i++;;i++) { if(s[i]==')') break; a[1][l++]=(s[i]>='A'&&s[i]<='Z'?s[i]-'A'+'a':s[i]); } t++; if(t!=3)//吞空格 i++; } else if(s[i]=='{') { int l=0; for(i++;;i++) { if(s[i]=='}') break; a[0][l++]=(s[i]>='A'&&s[i]<='Z'?s[i]-'A'+'a':s[i]); } t++; if(t!=3)//吞空格 i++; } else if(s[i]=='[') { int l=0; for(i++;;i++) { if(s[i]==']') break; a[2][l++]=(s[i]>='A'&&s[i]<='Z'?s[i]-'A'+'a':s[i]); } t++; if(t!=3)//吞空格 i++; } else printf("%c",s[i]); if(t==3) { if(r==0&&a[0][0]>='a'&&a[0][0]<='z')//首字母大写 a[0][0]=a[0][0]-'a'+'A'; r=1; printf("%s %s %s",a[0],a[1],a[2]); memset(a,0,sizeof(a)); t=0; } } printf("\n"); } return 0; }
(校赛) URAL 1993 This cheeseburger you don't need,布布扣,bubuko.com
(校赛) URAL 1993 This cheeseburger you don't need
标签:des style color os strong io for art
原文地址:http://blog.csdn.net/u013582254/article/details/38232923