From 300898b6760dab7654025a0103bc43214518d5ae Mon Sep 17 00:00:00 2001 From: Bohdan Yanchyk Date: Thu, 26 Mar 2020 20:05:21 +0000 Subject: [PATCH] =?UTF-8?q?Aktualizovat=20=E2=80=9Edu3/program.c=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du3/program.c | 56 ++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/du3/program.c b/du3/program.c index 057e65e..0c69234 100644 --- a/du3/program.c +++ b/du3/program.c @@ -1,30 +1,26 @@ -#include -#include -#include -int main() -{ - float x=0; - float value =0; - int count =0; - float arr[50]; - while(scanf("%f",&value)!=EOF){ - if(isalpha(value)!=0){ - return 0; - } - if(count !=0){ - arr[count-1]=value; - } - else{ - x=value; - } - count++; - } - value=0; - for(int i =0;i +#include +#include +#include + +int main() +{ + printf("Enter date: "); + + char dateStr[11]; + struct tm t; + + fgets(dateStr, 11, stdin); + + strptime(dateStr, "%d.%m.%Y", &t); + + t.tm_mday += 7; + + strftime(dateStr, sizeof(dateStr), "%d.%m.%Y", &t); + + printf("The day of the week is %s", dateStr); + exit(EXIT_SUCCESS); + + return 0; +}