1
This commit is contained in:
		
							parent
							
								
									5bf178f1d1
								
							
						
					
					
						commit
						9e708884ec
					
				
							
								
								
									
										24
									
								
								a1/program.c
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								a1/program.c
									
									
									
									
									
								
							@ -0,0 +1,24 @@
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <ctype.h>
 | 
			
		||||
 | 
			
		||||
int main() {
 | 
			
		||||
    int ch;
 | 
			
		||||
    int line_count = 0; 
 | 
			
		||||
 | 
			
		||||
    while ((ch = getchar()) != EOF) {
 | 
			
		||||
        if (islower(ch)) {  
 | 
			
		||||
            putchar(toupper(ch)); 
 | 
			
		||||
        } else if (isupper(ch)) {
 | 
			
		||||
            putchar(tolower(ch)); 
 | 
			
		||||
        } else if (ch == '\n') {
 | 
			
		||||
            putchar(ch);  
 | 
			
		||||
            line_count++; 
 | 
			
		||||
        } else if (ch >= 32 && ch <= 126) { 
 | 
			
		||||
            putchar(ch);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    printf("\nPocet riadkov: %d\n", line_count); 
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user