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; +}