From c5fcf7179a83ef65c86c6a4a390029149e518649 Mon Sep 17 00:00:00 2001 From: Franciszek Malinka Date: Tue, 5 Oct 2021 21:49:54 +0200 Subject: Duzy commit ze smieciami --- semestr-4/sieci/warsztaty8/185951.cpp | 109 ++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 semestr-4/sieci/warsztaty8/185951.cpp (limited to 'semestr-4/sieci/warsztaty8/185951.cpp') diff --git a/semestr-4/sieci/warsztaty8/185951.cpp b/semestr-4/sieci/warsztaty8/185951.cpp new file mode 100644 index 0000000..df7c356 --- /dev/null +++ b/semestr-4/sieci/warsztaty8/185951.cpp @@ -0,0 +1,109 @@ +#include +using namespace std; + +int max_miesiac[12]={31,28,31,30,31,30,31,31,30,31,30,31}; +string dzien[2]={"dzien","dni"}; +string godziny[3]={"godzina","godziny","godzin"}; +string minuty[3]={"minuta","minuty","minut"}; +string sekundy[3]={"sekunda","sekundy","sekund"}; + +string wypisz(int a, char wyz) +{ + int dz=a/10; + int j=a%10; + if(wyz=='g'){ + if(j==1 and dz==0){ + return godziny[0]; + }else{ + if(j>=2 and j<=4 and (dz>=2 or dz==0)){ + return godziny[1]; + }else{ + return godziny[2]; + } + } + } + if(wyz=='m'){ + if(j==1 and dz==0){ + return minuty[0]; + }else{ + if(j>=2 and j<=4 and (dz>=2 or dz==0)){ + return minuty[1]; + }else{ + return minuty[2]; + } + } + } + if(wyz=='s'){ + if(j==1 and dz==0){ + return sekundy[0]; + }else{ + if(j>=2 and j<=4 and (dz>=2 or dz==0)){ + return sekundy[1]; + }else{ + return sekundy[2]; + } + } + } + return ""; +} + +int main(){ +int rok,mies,dni,godz,mi,sek; +long long time1=0,time2=0; +char p; +cin>>rok>>p>>mies>>p>>dni>>godz>>p>>mi>>p>>sek; +time1=time1+sek+(mi*60)+(godz*3600)+((dni-1)*86400); +for(int i=0;i>rok>>p>>mies>>p>>dni>>godz>>p>>mi>>p>>sek; +cin>>p; +time2=time2+sek+(mi*60)+(godz*3600)+((dni-1)*86400); +for(int i=0;i0){ + if(dni==1){ + cout<0){ + cout<0){ + cout<0){ + cout<