From 36c9c8afd33c136692ad38295f3f66874f0b13fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristi=C3=A1n=20Ruj=C3=A1k?= Date: Wed, 13 Mar 2019 22:51:21 +0000 Subject: [PATCH] Aktualizovat "program.c --- program.c | 79 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 20 deletions(-) diff --git a/program.c b/program.c index 43b5bc1..bc92904 100644 --- a/program.c +++ b/program.c @@ -60,8 +60,7 @@ int main() else if((d>=1 && d<=30) && m==4 || m==6 || m==9 || m==11) {} - while (ko = 0){ - return 0;} + @@ -91,6 +90,10 @@ int main() + + + + else if(d==29 && m==2 && (y%400==0 ||(y%4==0 && y%100!=0))) {} @@ -105,6 +108,9 @@ int main() + + + else{ printf("Nespravny datum\n"); return 0; @@ -115,6 +121,11 @@ int main() + + + + + else { printf("Nespravny datum\n"); @@ -134,11 +145,21 @@ int main() else { - - - - - + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} + @@ -147,25 +168,38 @@ int main() } + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} + - - - - + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} + struct tm t = { .tm_year=y-1900, .tm_mon=m-1, .tm_mday=d }; t.tm_mday += 7; mktime(&t); - - - - - - - - - + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} + + if(ko = 0){ + return 0;} if(t.tm_mday <10 && t.tm_mon+1 < 10){ @@ -179,6 +213,9 @@ int main() + + + else if(t.tm_mday < 10){ printf(" %d.%d.%d\n\n", t.tm_mday, t.tm_mon+1, t.tm_year+1900); } @@ -205,6 +242,8 @@ int main() + + else{ printf("%d.%d.%d\n\n", t.tm_mday, t.tm_mon+1, t.tm_year+1900); }