du1
This commit is contained in:
parent
37fa18f4e2
commit
e99071597d
@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
int main() {
|
||||
int c;
|
||||
char output;
|
||||
int count_line = 0;
|
||||
|
||||
while ((c = getchar()) != EOF) {
|
||||
if (islower(c)) {
|
||||
output = toupper(c);
|
||||
}
|
||||
else if (isupper(c)) {
|
||||
output = tolower(c);
|
||||
}
|
||||
else if (isgraph(c) || c == ' ') {
|
||||
output = c;
|
||||
}
|
||||
else {
|
||||
output = c;
|
||||
}
|
||||
putchar(output);
|
||||
if (c == '\n') {
|
||||
count_line++;
|
||||
}
|
||||
}
|
||||
// printf("Number of lines: %d\n", count_line);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user