From fc03c592a4f1f026e3f85bee4caa7ba8d30ae0b6 Mon Sep 17 00:00:00 2001 From: Yaroslav Orlianskyi Date: Tue, 1 Mar 2022 18:51:15 +0100 Subject: [PATCH] SAD --- du1/program.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/du1/program.c b/du1/program.c index 0f9d5b3..7cb165e 100644 --- a/du1/program.c +++ b/du1/program.c @@ -2,14 +2,24 @@ int main(){ int c = 0; - //int big; + int a = 0; + char small[] = "abcdefghijklmnopqrstuvwxyz"; + char big[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; char d; while( c != EOF){ c = getchar(); - if (c >= 'a' && c <= 'z'){ - d = c - 'a' + 'A'; + d = c; + int a = 0; + while(a > 26){ + if(d == small[a]){ + c = big[a]; + break; + }else if(d == big[a]){ + c = small[a]; + break; + } } - putchar (d); + putchar (c); } return 0; }