/*ひな型Hello*/
#include <stdio.h>
main(){
char s[100]=" ";
char s1[20]="%s";
char s2[20]="%s\n";
char s3[20]=" input: ";
char s4[20]="output: %s\n";
int i;
printf(s1,s3);
scanf(s1,s);
i=0;
while(s[i]!='\0'){
if(0x41<=s[i]&&s[i]<=0x5a) s[i]+=32;
else if(0x61<=s[i]&&s[i]<=0x7a) s[i]-=32;
i++;
}
printf(s4,s);
}
0 件のコメント:
コメントを投稿