NYOJ 604 小明的难题

地址:http://acm.nyist.net/JudgeOnline/problem.php?pid=604

 1 #include <stdio.h>
 2 int main()
 3 {
 4     char ch,str[101];
 5     int n,i;
 6     scanf("%d",&n);
 7     getchar();
 8     while(n--)
 9     {
10         gets(str);
11         for(i = 0; str[i] != '\0'; i++)
12         {
13             if((i % 2 == 0)&&('a' <= str[i]&&str[i] <= 'z'))
14             {
15                 printf("%c",str[i] - 32);
16             }
17             else
18             printf("%c",str[i]);
19         }
20         printf("\n");
21     }
22 }

posted on 2012-11-24 22:16  mycapple  阅读(326)  评论(0编辑  收藏  举报

导航