From 5ae1e8f5aa91eb231645714aacc310ff3a59b88f Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Sun, 20 Feb 2022 13:33:26 +0100 Subject: [PATCH] 123 --- du1/program.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/du1/program.c b/du1/program.c index 0a94a8b..8771d35 100644 --- a/du1/program.c +++ b/du1/program.c @@ -2,19 +2,23 @@ int main(){ int c = 1; + int a = 0; + int b = 0; char small[] = "abcdefghijklmnopqrstuvwxyz"; char big[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; while(c = 1){ c = getchar(); - for(int i = 0; i < 26; i++){ - if(c == small[i]){ - c = big[i]; + while(a < 26){ + if(c == small[a]){ + c = big[a]; break; - }else if(c == big[i]){ - c = small[i]; + }else if(c == big[a]){ + c = small[a]; break; } } + b++; } + printf("Vot = %d and vot = %d\n", a, b); return 0; }