lastonehopefully7
This commit is contained in:
parent
453f687284
commit
e67571d60c
23
a1/program.c
23
a1/program.c
@ -1,10 +1,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int c = 0;
|
int c = 0;
|
||||||
int pocet_riadkov = 0;
|
int pocet_riadkov = 0;
|
||||||
int predchadzajuci = 0;
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
c = getchar();
|
c = getchar();
|
||||||
@ -13,18 +11,10 @@ int main() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isalpha(c)) {
|
if (c >= 'a' && c <= 'z') {
|
||||||
if (c >= 'a' && c <= 'z') {
|
c = c - 'a' + 'A';
|
||||||
c = c - 'a' + 'A';
|
} else if (c >= 'A' && c <= 'Z') {
|
||||||
} else if (c >= 'A' && c <= 'Z') {
|
c = c - 'A' + 'a';
|
||||||
c = c - 'A' + 'a';
|
|
||||||
}
|
|
||||||
} else if (c == 1425) {
|
|
||||||
c = 'q';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (predchadzajuci == 'c' && c == '\'') {
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
@ -32,7 +22,6 @@ int main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
putchar(c);
|
putchar(c);
|
||||||
predchadzajuci = c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("\nLines count: %d\n", pocet_riadkov);
|
printf("\nLines count: %d\n", pocet_riadkov);
|
||||||
|
Loading…
Reference in New Issue
Block a user