#include <stdio.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
/** /
int Chop_if(char str[],char ch){
int i = 0;
for (i = 0; str[i] != '\0'; i++);
if (i > 0){
if(str[i - 1] == ch) str[i - 1] = '\0';
}
else return -1;
return 0;
}
/**/
int StringToUpper(char str[]){//inplace modify.
int i = 0;
for (i
= 0; str
[i
] != '\0'; i
++) str
[i
] = toupper(str
[i
]); return 0;
}
/*
int PrintValue(char str[]){
int i = 0;
for (i = 0; str[i] != '\0'; i++)printf("%d ",str[i]);
return 0;
}
*/
int main(){
static const int Len = 4;
char buff[Len];
#if 1 //can process both for problem.
while (1){
if (fgets(buff
, Len
, stdin
) == NULL
&& errno
!= EINVAL
) break; //Chop_if(buff,'\n');
//Chop_if(buff,26);//value of eof at char value.but eof can get int value.
StringToUpper(buff);
//PrintValue(buff);
}
#else
int ch = EOF;
while ((ch
= getchar()) != EOF
){//よく考えたら、stdinが詰まってるのでブロッキングしません! }
#endif
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjdHlwZS5oPgojaW5jbHVkZSA8ZXJybm8uaD4KI2luY2x1ZGUgPHN0cmluZy5oPgovKiogLwppbnQgQ2hvcF9pZihjaGFyIHN0cltdLGNoYXIgY2gpewoJaW50IGkgPSAwOwoJZm9yIChpID0gMDsgc3RyW2ldICE9ICdcMCc7IGkrKyk7CglpZiAoaSA+IDApewoJCWlmKHN0cltpIC0gMV0gPT0gY2gpIHN0cltpIC0gMV0gPSAnXDAnOwoJfQoJZWxzZSByZXR1cm4gLTE7CglyZXR1cm4gMDsKfQovKiovCmludCBTdHJpbmdUb1VwcGVyKGNoYXIgc3RyW10pey8vaW5wbGFjZSBtb2RpZnkuCglpbnQgaSA9IDA7Cglmb3IgKGkgPSAwOyBzdHJbaV0gIT0gJ1wwJzsgaSsrKSBzdHJbaV0gPSB0b3VwcGVyKHN0cltpXSk7CglyZXR1cm4gMDsKfQovKgppbnQgUHJpbnRWYWx1ZShjaGFyI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