Создал(а) 'du1.c'
This commit is contained in:
parent
653cd1c174
commit
95b8c0d7f5
31
du1.c
Normal file
31
du1.c
Normal file
@ -0,0 +1,31 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
int main(){
|
||||
int count = 0;
|
||||
int c = 0;
|
||||
int riadok = 0;
|
||||
printf("%c",c);
|
||||
while(1){
|
||||
c = getchar();
|
||||
if(c == -1){
|
||||
break;
|
||||
}
|
||||
count = 0;
|
||||
if (c >= 'a' && c <= 'z'){
|
||||
c = c - 32;
|
||||
printf("%c \n", c);
|
||||
count = 1;
|
||||
riadok++;
|
||||
}
|
||||
if (c >= 'A' && c <= 'Z' && count == 0){
|
||||
c = c + 32;
|
||||
printf("%c \n", c);
|
||||
riadok++;
|
||||
}
|
||||
c = getchar();
|
||||
count = 0;
|
||||
}
|
||||
printf("Počet riadkov: %d", riadok);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user