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 }