From 2d4380cb6d54f4e89d190fd1080a3e36bf811e48 Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Tue, 1 Mar 2022 18:30:30 +0100 Subject: [PATCH] SAD --- du1/program.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/du1/program.c b/du1/program.c index 8771d35..e1d516d 100644 --- a/du1/program.c +++ b/du1/program.c @@ -1,24 +1,17 @@ #include int main(){ - int c = 1; - int a = 0; - int b = 0; - char small[] = "abcdefghijklmnopqrstuvwxyz"; - char big[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - while(c = 1){ + int c = 0; + int big; + char d; + while( c != EOF){ c = getchar(); - while(a < 26){ - if(c == small[a]){ - c = big[a]; - break; - }else if(c == big[a]){ - c = small[a]; - break; - } + if (c >= 'a' && c <= 'z'){ + big = c - 'a' + 'A'; + d = big; + c = d; } - b++; + putchar (c); } - printf("Vot = %d and vot = %d\n", a, b); return 0; }