31 lines
529 B
C
31 lines
529 B
C
#include <stdio.h>
|
|
|
|
char toUpper(char input) {
|
|
if (input >= 'a') {
|
|
return input - 'a' + 'A';
|
|
}
|
|
else {
|
|
return input;
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
char ch;
|
|
FILE* fl;
|
|
fl = fopen("upper.txt", "w+");
|
|
while (1) {
|
|
ch = getchar();
|
|
if (ch == '#') {
|
|
break;
|
|
}
|
|
fprintf(fl, "%c", toUpper(ch));
|
|
}
|
|
fflush(fl);
|
|
// fclose(fl);
|
|
// fl = fopen("upper.txt", "r");
|
|
rewind(fl);
|
|
while(!feof(fl)) {
|
|
putchar(fgetc(fl));
|
|
}
|
|
return 0;
|
|
} |