From 2e5b5fe78ba28fee99905f4bb3ceb3623e9042e8 Mon Sep 17 00:00:00 2001 From: kr820js Date: Thu, 22 Feb 2024 13:36:59 +0100 Subject: [PATCH] corection2 --- cv1/program.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cv1/program.c b/cv1/program.c index 47488bc..8e5a9e8 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -4,14 +4,18 @@ int main() { char c; + int counter=0; while ((c = getchar()) != EOF) { if(c<='z'&&c>='a'){ c=c+('A'-'a'); }else if(c<='Z'&&c>='A'){ c=c-('A'-'a'); } + if(c=='\n'){ + counter++; + } printf("%c",c); } - printf("\n"); + printf("\nLines count: %d",counter); return 0; }