Add 'du1/program.c'
This commit is contained in:
parent
6be5b89cc1
commit
07d79564b5
31
du1/program.c
Normal file
31
du1/program.c
Normal file
@ -0,0 +1,31 @@
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
int main (){
|
||||
int c;
|
||||
int counter;
|
||||
counter=0;
|
||||
c=getchar();
|
||||
while (1==1){
|
||||
if (c=='\n')
|
||||
counter=counter+1;
|
||||
if (c==EOF){
|
||||
return -1;
|
||||
}
|
||||
if ('a' <= c && c <= 'z') {
|
||||
putchar(toupper (c));
|
||||
printf("\nPočet riadkov: %d\n",counter);
|
||||
break;
|
||||
} else{
|
||||
putchar(tolower (c));
|
||||
printf("\nPočet riadkov: %d\n",counter);
|
||||
break;
|
||||
}
|
||||
|
||||
putchar (c);
|
||||
assert (! ferror (stdin));
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user