text
stringlengths
49
983k
#include <iostream> #include <cstdio> using namespace std; int hms2s(int h, int m, int s) { int ret = s; for (int i = 0; i < h; i++) { ret += 3600; } for (int i = 0; i < m; i++) { ret += 60; } return ret; } void printhms(int s) { int h = 0, m = 0; while (s >= 3600) { s -= 3600; h++; } while (s >= 60) { s -= 60; m++; } printf("%02d:%02d:%02d\n", h, m, s); } int main() { while (true) { int h, m, s; cin >> h >> m >> s; if (h == -1 && m == -1 && s == -1) { break; } int rest = 7200 - hms2s(h, m, s); printhms(rest); printhms(rest * 3); } }
#include <bits/stdc++.h> using namespace std; int main() { int h, m, s; while (cin >> h >> m >> s, h >= 0) { int tl = (3600 * 2) - (3600 * h + 60 * m + s), tri = tl * 3; printf("%02d:%02d:%02d\n", tl/60/60, tl/60%60, tl%60); printf("%02d:%02d:%02d\n", tri/60/60, tri/60%60, tri%60); } return 0; }
#include<iostream> using namespace std; int h,m,s,r; void b(){ h=r/3600,m=(r%3600)/60,s=r%60; if(h/10<1)cout<<0;cout<<h<<":"; if(m/10<1)cout<<0;cout<<m<<":"; if(s/10<1)cout<<0;cout<<s<<endl; } int main(){ while(cin>>h>>m>>s){ if(h==-1)break; r=120*60-h*60*60-m*60-s; b(); r*=3; b(); } }
#include<iostream> #include<cstdio> using namespace std; int main() { int h,m,s,t; for(;cin>>h>>m>>s;) { if(h==-1) break; int a,b,x; for(int i=0;i<2;i++) { t=7200-(h*3600+m*60+s); if(i==1) t*=3; a=t/3600; t%=3600; b=t/60; t%=60; printf("%02d:%02d:%02d\n",a,b,t); } } }
#include<iostream> #include<cstdio> #include<cmath> #include<vector> #include<string> #include<queue> #include<map> #include<stack> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; void func(int ts){ int h,m,s; h = ts / (60*60); ts -= 60*60*h; m = ts / 60; ts -= 60*m; s = ts; printf("%02d:%02d:%02d\n", h, m, s); } int main(void){ int h,m,s; while(scanf("%d %d %d", &h, &m, &s) && h != -1){ int ts = (60*60*2)-(60*60*h+60*m+s); func(ts); func(ts*3); } return 0; }
#include<cstdio> #include<iostream> #include<algorithm> #include<vector> using namespace std; int main(){ int H,M,S,flg=1; while(cin>>H>>M>>S){ flg=1; if(H==-1)break; S+=M*60; S+=H*3600; S=7200-S; continu:; if(S/3600<10)cout<<"0"; cout<<S/3600<<":"; if((S%3600)/60<10)cout<<"0"; cout<<(S%3600)/60<<":"; if((S%3600)%60<10)cout<<"0"; cout<<(S%3600)%60<<endl; if(flg==1){ flg=0;S*=3;goto continu; } } return 0; }
#include <iostream> #include <string> #include <cstdio> using namespace std; void printFormatDate(int t){ string str; int h, m, s; h = t/3600; m = t%3600/60; s = t%60; printf("%02d:%02d:%02d\n", h, m, s); } int main(){ int h, m, s; int time; while (cin >> h >> m >> s) { if (h == -1 && m == -1 && s == -1) { break; } time = 120*60 - (h*60*60 + m*60 + s); printFormatDate(time); printFormatDate(time*3); } return 0; }
#include <iostream> #include <cmath> #include <algorithm> #include <cstdio> using namespace std; const int A = 2 * 3600; void show( int s ) { int a = s / 3600; int b = s / 60 % 60; int c = s % 60; printf("%02d:%02d:%02d\n", (int)a, (int)b, (int)c); } int main() { int h, m, s; while(cin >> h >> m >> s && h >= 0 ) { int a = h*3600 + m*60 + s; int aa = A - a; show( aa ); show( aa*3 ); } return 0; }
#include <iostream> #include <string> #include <vector> #include <cstdio> using namespace std; int main(){ int T,H,S,t3,h3,s3,sum,sum3,t,h,s; for(;;){ cin>>T>>H>>S; if(T==-1&&H==-1&&S==-1)break; sum=7200-(T*3600+H*60+S); t=sum/3600; s=sum%60; h=(sum-(t*3600)-s)/60; sum3=sum*3; t3=sum3/3600; s3=sum3%60; h3=(sum3-(t3*3600)-s3)/60; printf("%02d:%02d:%02d",t,h,s); cout<<endl; printf("%02d:%02d:%02d",t3,h3,s3); cout<<endl; } return 0; }
#include<iostream> #include<cstdio> #include<algorithm> #include<string> #include<cstring> using namespace std; int main(){ int h,m,s; while(1){ scanf("%d %d %d",&h,&m,&s); if(h == -1 && m == -1 && s == -1) break; int ans1 = 7200; int ans2 = 7200; ans1 -= h*3600 + m * 60 + s; ans2 = ans1 * 3; printf("%02d:%02d:%02d\n%02d:%02d:%02d\n",ans1/3600,(ans1%3600)/60,ans1%60,ans2/3600,(ans2%3600)/60,ans2%60); } return 0; }
#include <cstdio> #include <iostream> #include <vector> #include <algorithm> using namespace std; int main(){ int h,m,s; while(cin>>h>>m>>s&&!(h==-1&&m==-1&&s==-1)){ int lefts=120*60; int nh,nm,ns; lefts-=(h*60*60+m*60+s); nh=lefts/3600; lefts%=3600; nm=lefts/60; lefts%=60; ns=lefts; printf("%02d:%02d:%02d\n",nh,nm,ns); lefts=(120*60-(h*60*60+m*60+s))*3; nh=lefts/3600; lefts%=3600; nm=lefts/60; lefts%=60; ns=lefts; printf("%02d:%02d:%02d\n",nh,nm,ns); } return 0; }
#include<iostream> #include<cstdio> using namespace std; int main(){ int h,m,s,x,y,z; while(true){ cin >> h >> m >> s; if(h == -1 && m == -1 && s == -1) break; s += (h*3600) + (m*60); s = 7200 - s; z = s * 3; h = s/3600; m = (s%3600)/60; s = (s%3600)%60; x = z/3600; y = (z%3600)/60; z = (z%3600)%60; printf("%02d:%02d:%02d\n",h,m,s); printf("%02d:%02d:%02d\n",x,y,z); } }
#include<cstdio> #include<algorithm> #include<vector> #include<string> #include<iostream> #include<queue> #include<map> #include<set> #include<complex> #include<stack> #include<cmath> using namespace std; #define reps(i,f,n) for(int i=f;i<int(n);i++) #define rep(i,n) reps(i,0,n) int main(){ int a,b,c; while(cin>>a>>b>>c){ if(a==-1)break; int sum = 120*60-((a*60+b)*60+c); int sum2 = sum*3; vector<int> s; rep(i,3){ s.push_back(sum%60); sum/=60; } vector<int> s2; rep(i,3){ s2.push_back(sum2%60); sum2/=60; } printf("%02d:%02d:%02d\n",s[2],s[1],s[0]); printf("%02d:%02d:%02d\n",s2[2],s2[1],s2[0]); } }
#include <cstdio> #include <iostream> using namespace std; int main() { int h, m, s, h3, m3, s3; while (1){ cin >> h >> m >> s; if (h < 0){ break; } m += 60 * h; s += 60 * m; s = 7200 - s; s3 = s * 3; m = s / 60; s %= 60; h = m / 60; m %= 60; m3 = s3 / 60; s3 %= 60; h3 = m3 / 60; m3 %= 60; printf("%02d:%02d:%02d\n%02d:%02d:%02d\n", h, m, s, h3, m3, s3); } return 0; }
#include <bits/stdc++.h> using namespace std; int main(){ long long a,b,c,s,ss; while(1){ cin >> a >> b >> c; if(a<0 or b<0 or c<0){ return 0; } s=7200-a*3600-b*60-c; ss=(7200-a*3600-b*60-c)*3; cout << 0 << s/3600 << ":"; s%=3600; cout << ((s<600)?"0":"") << s/60 << ":"; s%=60; cout << ((s<10)?"0":"") << s << endl; cout << 0 << ss/3600 << ":"; ss%=3600; cout << ((ss<600)?"0":"") << ss/60 << ":"; ss%=60; cout << ((ss<10)?"0":"") << ss << endl; } }
/* 3???????????£???????????????????????± */ #include <cstdio> using namespace std; int t, h, s; int main() { while (1) { scanf("%d%d%d", &t, &h, &s); if (t == -1 && h == -1 && s == -1) return 0; int rem_sec = 7200 - (t*3600 + h*60 + s); printf("%02d:%02d:%02d\n", rem_sec/3600, rem_sec%3600/60, rem_sec%60); rem_sec *= 3; printf("%02d:%02d:%02d\n", rem_sec/3600, rem_sec%3600/60, rem_sec%60); } }
#include <cstdio> int main() { int l, m, n; while(~scanf("%d %d %d", &l, &m, &n), ~l && ~m && ~n){ long long total = l * 60LL * 60 + m * 60 + n, remaining = 120 * 60 - total; printf("%02lld:%02lld:%02lld\n", remaining / 60 / 60, remaining / 60 % 60, remaining % 60); remaining *= 3; printf("%02lld:%02lld:%02lld\n", remaining / 60 / 60, remaining / 60 % 60, remaining % 60); } return 0; }
#include <iostream> #include <cstdio> using namespace std; int main(){ int h,m,s,total,h1,m1,s1,total1; while(1){ cin >> h >> m >> s; if(h == -1 && m == -1 && s == -1){ break; } total1 = h*3600 + m*60 + s; total1 = 120*60 - total1; total1 *= 3; total = h*3600 + m*60 + s; total = 120*60 - total; h = total/3600; total %= 3600; m = total/60; total %= 60; s = total; h1 = total1/3600; total1 %= 3600; m1 = total1/60; total1 %= 60; s1 = total1; printf("%02d:%02d:%02d\n",h,m,s); printf("%02d:%02d:%02d\n",h1,m1,s1); } }
#include <iostream> #include <sstream> #include <algorithm> #include <cstdio> #include <string> #include <vector> #include <cmath> //AOJ0074 #define rep(x,to) for(int x=0;x<to;x++) #define rep2(x,from,to) for(int x=from;x<to;x++) using namespace std; int main(void){ int tm[3]; while(cin >> tm[0] >> tm[1] >> tm[2]){ if(tm[0]==-1 && tm[1]==-1 && tm[2]==-1 || cin.eof()) break; int fl[3]={1,59,60}; rep(i,3) fl[i] -= tm[i]; rep(i,2) while(fl[2-i] >= 60){ fl[2-i] -=60; fl[1-i]++; } printf("%02d:%02d:%02d\n",fl[0],fl[1],fl[2]); rep(i,3) fl[i] *= 3; rep(i,2) while(fl[2-i] >= 60){ fl[2-i] -=60; fl[1-i]++; } printf("%02d:%02d:%02d\n",fl[0],fl[1],fl[2]); } return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; int main() { cin.tie(0); ios_base::sync_with_stdio(false); cout << fixed << setprecision(10); int T, H, S; while (cin >> T >> H >> S, T != -1) { int rem = 2 * 3600 - T * 3600 - H * 60 - S; printf("%02d:%02d:%02d\n", rem / 3600, rem / 60 % 60, rem % 60); rem *= 3; printf("%02d:%02d:%02d\n", rem / 3600, rem / 60 % 60, rem % 60); } return 0; }
#include <cstdio> #include <string> using namespace std; int main() { int h[2], m[2], s[2], t, u, w, v = 7200; while (scanf("%d %d %d", &h[0], &m[0], &s[0]) && h[0] != -1 && m[0] != -1 && s[0] != -1) { t = h[0] * 3600 + m[0] * 60 + s[0]; u = v - t; w = u * 3; h[1] = u / 3600; m[1] = (u % 3600) / 60; s[1] = (u % 3600) % 60; printf("%02d:%02d:%02d\n", h[1], m[1], s[1]); h[1] = w / 3600; m[1] = (w % 3600) / 60; s[1] = (w % 3600) % 60; printf("%02d:%02d:%02d\n", h[1], m[1], s[1]); } }
#include<iostream> using namespace std; int main() { int t, m, s; int rest; while (cin>>t>>m>>s) { if (t==-1 && m==-1 && s==-1) break; rest = 120*60 - t*60*60-m*60-s; s = rest%60; m = (rest/60)%60; t = (rest/60)/60; printf("%02d:%02d:%02d\n", t, m, s); rest *= 3; s = rest%60; m = (rest/60)%60; t = (rest/60)/60; printf("%02d:%02d:%02d\n", t, m, s); } return 0; }
#include <iostream> #include <cstdio> using namespace std; typedef long long ll; const int T = 120*60; int main() { ll h, s, m; ll t; while (cin >> h >> m >> s && h != -1 ){ t = (ll)T - (h*60*60 + m*60 + s ); printf ("%02lld:%02lld:%02lld\n", t/3600, t%3600/60, t%3600%60 ); t *= 3L; printf ("%02lld:%02lld:%02lld\n", t/3600, t%3600/60, t%3600%60 ); } // end loop return 0; }
#include<iostream> #include<ios> using namespace std; int h,m,s; int main() { while(cin>>h>>m>>s,h>=0) { int a,b,c; printf("%02d:%02d:%02d\n",a=2-h-(m||s),b=m||s?60-m-!!s:0,c=s?60-s:0); c*=3; b=b*3+c/60;c%=60; a=a*3+b/60;b%=60; printf("%02d:%02d:%02d\n",a,b,c); } }
#include<iostream> #include<stdio.h> using namespace std; int main(void){ int h,m,s; while(cin>>h>>m>>s){ if(h==-1&&m==-1&&s==-1)break; int sum=2*60*60-h*60*60-m*60-s; int tmp=3*sum; printf("%02d:%02d:%02d\n%02d:%02d:%02d\n",sum/3600,sum%3600/60,sum%60,tmp/3600,tmp%3600/60,tmp%60); } }
#include <iostream> #include <cstdio> using namespace std; int main(){ while(1){ int h,m,s; cin >> h >> m >> s; if(h==-1) break; int t = 120*60 -h*3600 -m*60 -s; printf("%02d:%02d:%02d\n", t/3600, (t/60)%60, t%60); t *= 3; printf("%02d:%02d:%02d\n", t/3600, (t/60)%60, t%60); } return 0; }
#include <iostream> using namespace std; int main(){ int h, m, s; while(1){ cin >> h >> m >> s; if(h==-1 && m==-1 && s==-1) break; int rec=h*3600+m*60+s; int ans=120*60-rec; int ans3=ans*3; int a1, a2, a3; a1=ans/3600; ans-=a1*3600; a2=ans/60; ans-=a2*60; a3=ans; if(a1<10) cout << 0; printf("%d:", a1); if(a2<10) cout << 0; printf("%d:", a2); if(a3<10) cout << 0; printf("%d\n", a3); a1=ans3/3600; ans3-=a1*3600; a2=ans3/60; ans3-=a2*60; a3=ans3; if(a1<10) cout << 0; printf("%d:", a1); if(a2<10) cout << 0; printf("%d:", a2); if(a3<10) cout << 0; printf("%d\n", a3); } return 0; }
#include<stdio.h> int main(){ int t,h,s,sum; while(scanf("%d %d %d",&t,&h,&s),t!=-1&&h!=-1&&s!=-1){ sum = 120*60 - t*3600 - h*60 - s; printf("%02d:%02d:%02d\n",sum/3600,(sum/60)%60,sum%60); sum *= 3; printf("%02d:%02d:%02d\n",sum/3600,(sum/60)%60,sum%60); } return(0); }
#include <cstdio> #include <iostream> using namespace std; void solve(int h, int m, int s){ int ts = 2*60*60 - ((h * 60 + m) * 60 + s); if(ts < 0) throw; h = ts / 3600; m = (ts % 3600) / 60; s = ts % 60; printf("%02d:%02d:%02d\n", h, m, s); ts *= 3; h = ts / 3600; m = (ts % 3600) / 60; s = ts % 60; printf("%02d:%02d:%02d\n", h, m, s); } int main(){ int h, m, s; while(cin >> h >> m >> s){ if(h == -1 && m == -1 && s == -1) break; solve(h, m, s); } return 0; }
#include<iostream> #include<math.h> #include<vector> #include<algorithm> #include<cstdio> using namespace std; int main(){ int t,h,s,sec,sec3; while(1){ cin>>t>>h>>s; if(t==-1&&h==-1&&s==-1){ break; } sec = 7200 - (3600*t+60*h+s); sec3=3*sec; printf("%02d:%02d:%02d\n",sec/3600,(sec%3600)/60,(sec%3600)%60); printf("%02d:%02d:%02d\n",sec3/3600,(sec3%3600)/60,(sec3%3600)%60); } return 0; }
#include <cstdio> int main() { int res; int h, m, s; while (scanf("%d%d%d", &h, &m, &s)) { res = 120; if (h==-1&&m==-1&&s==-1) break; m += h * 60; res -= m; if (s != 0) { res--; s = 60 - s; } h = (int)(res / 60); m = res - h * 60; // printf("%d\n",res); printf("%02d:%02d:%02d\n", h, m, s); res *= 3; s *= 3; res += s / 60; s -= s / 60 * 60; h = (int)(res / 60); m = res - h * 60; printf("%02d:%02d:%02d\n", h, m, s); } }
#include<stdio.h> int main(){ int a,b,c; while(1){ scanf("%d%d%d",&a,&b,&c); if(a==-1)return 0; int d=a*3600+b*60+c; int e=7200-d,f=e*3; printf("%02d:%02d:%02d\n%02d:%02d:%02d\n",e/3600,e%3600/60,e%60,f/3600,f%3600/60,f%60); } }
#include <cstdio> #include<iostream> #include <iomanip> using namespace std; int main(void){ int h,m,s; int ok; while(1){ cin>>h>>m>>s; if(h==-1&&m==-1&&s==-1) break; ok=120*60-(h*60*60+m*60+s); cout<<setfill('0')<<setw(2)<<ok/(60*60)<<":"<<setfill('0')<<setw(2)<<ok%(60*60)/60<<":"<<setfill('0')<<setw(2)<<ok%(60*60)%60<<endl; cout<<setfill('0')<<setw(2)<<(ok*3)/(60*60)<<":"<<setfill('0')<<setw(2)<<(ok*3)%(60*60)/60<<":"<<setfill('0')<<setw(2)<<(ok*3)%(60*60)%60<<endl; } return 0; }
#include<cstdio> #include<cstring> using namespace std; int main(){ int a,b,c; while(1){ scanf("%d%d%d",&a,&b,&c); if(a == -1 && b == -1 && c == -1)break; int g=0; g = a*3600+b*60+c; g = 7200 - g; printf("%02d:%02d:%02d\n",g/3600,g%3600/60,g%60); printf("%02d:%02d:%02d\n",(g*3)/3600,(g*3)%3600/60,(g*3)%60); } return 0; }
#include<stdio.h> #include<iostream> using namespace std; int main(){ int x,y,z; while(1){ cin>>x>>y>>z; if(x==-1&&y==-1&&z==-1)break; int a=0,b=0,c=0; int D=120*60; int dd=0; dd+=3600*x+60*y+z; D-=dd; int G=3*D; a=D/3600;D=D%3600; b=D/60;D=D%60; c=D; if(a<10)cout<<"0"; cout<<a<<":"; if(b<10)cout<<"0"; cout<<b<<":"; if(c<10)cout<<"0"; cout<<c<<endl; a=G/3600;G=G%3600; b=G/60;G=G%60; c=G; if(a<10)cout<<"0"; cout<<a<<":"; if(b<10)cout<<"0"; cout<<b<<":"; if(c<10)cout<<"0"; cout<<c<<endl; } return 0; }
#include <iostream> #include<string> #include<cstdio> #include<cmath> #include<algorithm> #include<vector> using namespace std; int main(){ int T,H,S,t3,h3,s3,a,b,c,d,e; while(cin>>T>>H>>S){ if(T==-1&&H==-1&&S==-1)break; a=T*3600+H*60+S; b=7200-a; c=b/3600; d=b%3600/60; e=b%3600%60; t3=3*b/3600; h3=3*b%3600/60; s3=3*b%3600%60; printf("%02d:%02d:%02d",c,d,e); cout<<endl; printf("%02d:%02d:%02d",t3,h3,s3); cout<<endl; } return 0; }
#include<stdio.h> int main(void) { int v,h2,m2,s2,s,h,m,g,e,f,d,a,b,c; scanf("%d %d %d",&a,&b,&c); while(a!=-1 && b!=-1 && c!=-1){ e=a*60; g=(e+b)*60+c; f=(2*3600)-g; h=f/3600; m=(f-(h*3600))/60; s=f-(h*3600+m*60); v=(3600*2-g)*3; h2=v/3600; m2=(v-h2*3600)/60; s2=(v-h2*3600)%60;; printf("%02d:%02d:%02d\n",h,m,s); printf("%02d:%02d:%02d\n",h2,m2,s2); scanf("%d %d %d",&a,&b,&c); } return 0; }
#include <iostream> using namespace std; int main() { int h,m,s,t; while (1) { cin >> h >> m >> s; if (h==-1)break; t = 120*60-(h*3600+m*60+s); printf("%02d:%02d:%02d\n",t/3600,(t/60)%60,t%60); t*=3; printf("%02d:%02d:%02d\n",t/3600,(t/60)%60,t%60); } return 0; }
#include<bits/stdc++.h> using namespace std; int h,m,s; bool input(){ cin>>h>>m>>s; if(h==-1)return false; return true; } char ans[2][100]; void solve(){ const int time = 60 * 120; int tmp = 60 * 60 * h + 60 * m + s; int now = time - tmp; tmp = now; int a_s = tmp % 60; tmp /= 60; int a_m = tmp % 60; tmp /= 60; int a_h = tmp; sprintf(ans[0],"%02d:%02d:%02d",a_h,a_m,a_s); tmp = now * 3; a_s = tmp % 60; tmp /= 60; a_m = tmp % 60; tmp /= 60; a_h = tmp; sprintf(ans[1],"%02d:%02d:%02d",a_h,a_m,a_s); } int main(){ while(input()){ solve(); cout<<ans[0]<<endl<<ans[1]<<endl; } }
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; int main(){ int h,m,s; while(1){ cin >> h >> m >> s; if(h == -1 && m == -1 && s == -1)break; int hms = 7200-(h*3600+m*60+s); h = hms/3600; hms-=3600*h; m = hms/60; hms-=60*m; s = hms; printf("%02d:%02d:%02d\n",h,m,s); hms = 3*(h*3600+m*60+s); h = hms/3600; hms-=3600*h; m = hms/60; hms-=60*m; s = hms; printf("%02d:%02d:%02d\n",h,m,s); } }
#include <iostream> #include <cstdio> using namespace std; int main(){ int h, m, s; while (1){ cin >> h >> m >> s; if (h == -1 && m == -1 && s == -1) break; int rest = 3600*2; int rest2 = 3600*2; rest = rest - (h * 3600 + m * 60 + s); rest2 = rest * 3; printf("%02d:%02d:%02d\n", rest / 3600, (rest % 3600) / 60, rest % 60); printf("%02d:%02d:%02d\n", rest2 / 3600, (rest2 % 3600) / 60, rest2 % 60); } }
#include<stdio.h> int main(void) { int h,m,s,h1,m1,s1,p,h2,m2,s2,h3,m3,s3,p1,p2; scanf("%d %d %d",&h,&m,&s); while(!(h==-1 && m==-1 && s==-1)){ h1=h*3600; m1=m*60; s1=s; p=h1+m1+s1; p1=7200-p; h2=p1/3600; p1=p1-(3600*h2); m2=p1/60; s2=p1%60; printf("0%d:",h2); if(m2<10){ printf("0%d:",m2); } else{ printf("%d:",m2); } if(s2<10){ printf("0%d\n",s2); } else{ printf("%d\n",s2); } p2=(7200-p)*3; h3=p2/3600; p2=p2-(3600*h3); m3=p2/60; s3=p2%60; printf("0%d:",h3); if(m3<10){ printf("0%d:",m3); } else{ printf("%d:",m3); } if(s3<10){ printf("0%d\n",s3); } else{ printf("%d\n",s3); } scanf("%d %d %d",&h,&m,&s); } return 0; }
#include<iostream> #include<cstdio> using namespace std; int main(){ int h, m, s, x; while(cin >> h >> m >> s){ if(h == -1) break; x = 120 * 60 - (3600 * h + 60 * m + s); h = x / 3600; m = (x - 3600 * h) / 60; s = x - 3600 * h - 60 * m; printf("%02d:%02d:%02d\n", h, m, s); h = 3 * x / 3600; m = (3 * x - 3600 * h) / 60; s = 3 * x - 3600 * h - 60 * m; printf("%02d:%02d:%02d\n", h, m, s); } return 0; }
#include <iostream> #include <sstream> #include <iomanip> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <climits> #include <cfloat> using namespace std; int main() { for(;;){ int h, m, s; cin >> h >> m >> s; if(h == -1) return 0; m += h * 60; s += m * 60; s = 2 * 60 * 60 - s; printf("%02d:%02d:%02d\n", s/60/60, s/60%60, s%60); s *= 3; printf("%02d:%02d:%02d\n", s/60/60, s/60%60, s%60); } }
#include<bits/stdc++.h> using namespace std; int main(){ int t,h,s; while(cin>>t>>h>>s&&t!=-1&&h!=-1&&s!=-1){ int a,b,c; a=2-t; b=0-h; c=0-s; if(b<0){ a-=1; b+=60; } if(c<0){ b-=1; c+=60; } if(b<0){ a-=1; b+=60; } if(c<0){ b-=1; c+=60; } printf("%.2d:%.2d:%.2d\n",a,b,c); int d=a*3; int e=b*3; int f=c*3; if(f>=60){ f-=60; e+=1; } if(f>=60){ f-=60; e+=1; } if(e>=60){ e-=60; d+=1; } if(e>=60){ e-=60; d+=1; } printf("%.2d:%.2d:%.2d\n",d,e,f); } return 0; }
#include <iostream> #include <algorithm> #include <cstdio> #include <vector> using namespace std; int toSec(int h, int m, int s) { return (h*60+m)*60+s; } vector<int> toHms(int sec) { vector<int> v; v.push_back(sec/(60*60)); sec -= v[0]*60*60; v.push_back(sec/60); v.push_back(sec - v[1]*60); return v; } int main() { int h, m, s; while(cin >> h >> m >> s) { if(h == -1 && m == -1 && s == -1) break; int sec = toSec(h,m,s); vector<int> v[2]; v[0] = toHms(toSec(2,0,0)-sec); v[1] = toHms((toSec(2,0,0)-sec)*3); for(int i = 0; i < 2; ++i) { printf("%02d:%02d:%02d\n", v[i][0], v[i][1], v[i][2]); } } return 0; }
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i, 0, n) #define ALL(v) v.begin(), v.end() #define MSG(a) cout << #a << " " << a << endl; #define REP(i, x, n) for (int i = x; i < n; i++) #define OP(m) cout << m << endl typedef long long ll; typedef unsigned long long ull; int main() { int t, h, s; while (cin >> t >> h >> s) { if (t == -1 && h == -1 && s == -1) break; int n = 7200 - (t * 3600 + h * 60 + s); int f = 3 * n; printf("%02d:%02d:%02d\n", n / 3600, n % 3600 / 60, n % 60); printf("%02d:%02d:%02d\n", f / 3600, f % 3600 / 60, f % 60); } return 0; }
#include <iostream> #include <cstdio> void print(int x, int y, int z){ if(x<10) printf("0"); printf("%d:", x); if(y<10) printf("0"); printf("%d:", y); if(z<10) printf("0"); printf("%d\n", z); } int main(){ while(1){ int h, m, s; scanf(" %d %d %d", &h, &m, &s); if(h==-1) break; int sum = h*3600+m*60+s; int ans = 2*3600-sum; int a=0, b=0, c=0; while(ans/3600>0){ ++a; ans-=3600; } while(ans/60>0){ ++b; ans-=60; } c=ans; print(a,b,c); ans = 3*(2*3600-sum); a=0; b=0; c=0; while(ans/3600>0){ ++a; ans-=3600; } while(ans/60>0){ ++b; ans-=60; } c=ans; print(a,b,c); } return 0; }
#include<iostream> #include<cstdio> using namespace std; int main(){ int a, b, c, nokori, nokori_3bai; while(true){ cin>>a>>b>>c; if(a==-1 && b==-1 && c==-1)break; nokori = 120*60; nokori = nokori - (3600*a + 60*b + c); nokori_3bai = nokori*3; printf("%02d:%02d:%02d\n", nokori/3600, (nokori/60)%60, (nokori)%60); printf("%02d:%02d:%02d\n", nokori_3bai/3600, (nokori_3bai/60)%60, (nokori_3bai)%60); } return 0; }
#include <iostream> #include <cstdio> using namespace std; int main() { int h, m, s; while(1){ cin >> h >> m >> s; if(h == -1 && m == -1 && s == -1) break; int t = 2 * 3600 - (h * 3600 + m * 60 + s); int u = t * 3; printf("%02d:%02d:%02d\n", t / 3600, t % 3600 / 60, t % 3600 % 60); printf("%02d:%02d:%02d\n", u / 3600, u % 3600 / 60, u % 3600 % 60); } }
#define _USE_MATH_DEFINES #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <cfloat> #include <ctime> #include <cassert> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include <queue> #include <numeric> #include <list> #include <iomanip> using namespace std; void print(int x){ printf("%02d:%02d:%02d\n",x/3600,(x/60)%60,x%60); } int main(){ int a,b,c; while(cin>>a>>b>>c,(~a||~b||~c)){ int sum =2*60*60 - a*3600 - b * 60 - c; print(sum); print(3 * sum); } return 0; }
#include <iostream> using namespace std; void prin(const int time){ int hour=time/3600; int min=(time-3600*hour)/60; int sec=time%60; char h[2],m[2],s[2]; h[0]='0'+hour/10; h[1]='0'+hour%10; m[0]='0'+min/10; m[1]='0'+min%10; s[0]='0'+sec/10; s[1]='0'+sec%10; cout<<h[0]<<h[1]<<':'<<m[0]<<m[1]<<':'<<s[0]<<s[1]<<'\n'; } int main(){ while(1){ int hour,min,sec,time; cin >> hour >> min >> sec ; if(hour==-1 && min==-1 && sec==-1) break; time=3600*hour+60*min+sec; time=7200-time; prin(time); prin(time*3); }; }
#include <iostream> #include <cstdio> using namespace std; int h, m, s; void solve(int v) { h = v/3600, m = (v%3600)/60, s = (v%3600)%60; printf("%02d:%02d:%02d\n", h, m, s); return ; } int main() { while(cin>>h>>m>>s && (h+m+s) != -3){ int t = 7200 - ((h*60+m)*60+s); solve(t); solve(t*3); } return 0; }
#include<iostream> #include<stdio.h> using namespace std; int h,m,s,sum; void pr(int x){ if(x<10)cout<<"0"; cout<<x; } void print(int x){ pr(x/3600); cout<<':'; pr(x/60%60); cout<<':'; pr(x%60); cout<<endl; } int main(){ while(cin>>h>>m>>s){ if(h==-1&&m==-1&&s==-1)break; sum=h*60*60+m*60+s; sum=120*60-sum; print(sum);print(sum*3); } }
#include<stdio.h> int main(void) { int a,s,d,z,x,c,f,k,v,b,n,i; scanf("%d %d %d",&a,&s,&d); while(!(a==-1 && s==-1 && d==-1)){ for(i=1;i<=100;i++){ f=(120*60-(s*60+a*3600+d))/60; k=(120*60-(s*60+a*3600+d))%60; x=f/60; c=f%60; z=(120*60*3-(s*60+a*3600+d)*3)/60; n=(120*60*3-(s*60+a*3600+d)*3)%60; v=z/60; b=z%60; } printf("%02d:%02d:%02d\n",x,c,k); printf("%02d:%02d:%02d\n",v,b,n); scanf("%d %d %d",&a,&s,&d); } return 0; }
#include <iostream> #include <sstream> #include <string> #include <algorithm> #include <vector> #include <iomanip> #include <queue> #include <cmath> #include <set> #include <map> #include <cstdlib> #include <cstdio> using namespace std; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, -1, 1}; void print_hms(int sec){ int h, m, s; s = sec % 60; m = (sec/60) % 60; h = sec/3600; printf("%02d:%02d:%02d\n", h, m, s); } int main(){ int h, m, s; while(cin >> h >> m >> s, s != -1 ){ const int twh = 7200; int sec; sec = h*60*60+m*60+s; print_hms(twh - sec); print_hms((twh - sec)*3); } return 0; }
#include <iostream> #include <cstdio> using namespace std; int main(void){ int sec, sec3; int used; int hh,mm,ss; int reth,retm,rets; while(cin >> hh >> mm >> ss){ if(hh == -1 && mm == -1 && ss == -1) break; used = hh * 3600 + mm * 60 + ss; sec = 7200 - used; sec3 = sec * 3; reth = sec / 3600; sec -= 3600 * reth; retm = sec / 60; sec -= 60 * retm; rets = sec; printf("%02d:%02d:%02d\n", reth, retm, rets); reth = sec3 / 3600; sec3 -= 3600 * reth; retm = sec3 / 60; sec3 -= 60 * retm; rets = sec3; printf("%02d:%02d:%02d\n", reth, retm, rets); } }
#include <iostream> #include <stdio.h> using namespace std; int main() { int h, m, s; while (cin >> h >> m >> s) { if ((h&m&s) == -1) break; int sum = h * 3600 + m * 60 + s; int ans1 = 7200 - sum; int ans2 = 7200 * 3 - sum * 3; printf("%02d:%02d:%02d\n", ans1 / 3600, ans1 % 3600 / 60, ans1 % 60); printf("%02d:%02d:%02d\n", ans2 / 3600, ans2 % 3600 / 60, ans2 % 60); } return 0; }
#include<iostream> #include<cstdio> using namespace std; int main(){ long h,m,s,r,r1,r2,r3; while(cin>>h){ cin>>m>>s; if(h==-1)break; r=7200-h*3600-m*60-s; r1=r/3600; r2=(r-r1*3600)/60; r3=r-r1*3600-r2*60; printf("%02d:%02d:%02d\n",r1,r2,r3); r*=3; r1=r/3600; r2=(r-r1*3600)/60; r3=r-r1*3600-r2*60; printf("%02d:%02d:%02d\n",r1,r2,r3); } return 0; }
#include<iostream> #include<string> using namespace std; int main(){ int h,m,s,e,r; while(true){ cin>>h>>m>>s; e=60*60*2; if(h==-1&&m==-1&&s==-1) break; e-=60*60*h; e-=60*m; e-=s; r=e*3; h=e/3600; e-=h*3600; m=e/60; e-=m*60; s=e; cout<<"0"<<h<<":"; if(m<10) cout<<"0"; cout<<m<<":"; if(s<10) cout<<"0"; cout<<s<<endl; h=r/3600; r-=h*3600; m=r/60; r-=m*60; s=r; cout<<"0"<<h<<":"; if(m<10) cout<<"0"; cout<<m<<":"; if(s<10) cout<<"0"; cout<<s<<endl; } return 0; }
#include <iostream> #include <cstdio> using namespace std; #define MAX 7200 //テープの容量(秒) //nは何倍録画かを指定する。 void solve(int time, int n) { int ans = (MAX - time) * n; int h, m, s; h = ans / 3600; ans -= h * 3600; m = ans / 60; ans -= m * 60; s = ans; printf("%02d:%02d:%02d\n", h, m, s); } int main(void) { int T, H, S; int time; int ans; while(cin >> T >> H >> S) { if(T == -1 && H == -1 && S == -1) break; time = T * 3600 + H * 60 + S; solve(time, 1); solve(time, 3); } return 0; }
#include<bits//stdc++.h> using namespace std; int main(){ int a,b,c; while(cin>>a>>b>>c,a+1||b+1||c+1){ int d=7200; int f=a*3600+b*60+c; d-=f; printf("%.2d:%.2d:%.2d\n",d/3600,d%3600/60,d%3600%60); d*=3; printf("%.2d:%.2d:%.2d\n",d/3600,d%3600/60,d%3600%60); } }
#include<iostream> #include<cstdio> using namespace std; int main(){ int h,m,s; while(cin>>h>>m>>s){ if(h==-1&&m==-1&&s==-1) break; int time=120*60 - h*60*60 - m*60 - s; printf("%02d:%02d:%02d\n",time/60/60,(time/60)%60,time%60%60); time*=3; printf("%02d:%02d:%02d\n",time/60/60,(time/60)%60,time%60%60); } return 0; }
#include<iostream> #include<string> #include<sstream> #include<vector> #include<map> #include<cctype> #include<cstdlib> using namespace std; #define REP(i, j) for(int i = 0; i < j; i++) #define FOR(i, j, k) for(int i = j; i < k; i++) const int N = 120 * 60; const int N3 = N * 3; void disp(int n){ stringstream ss; int h = n / (60 * 60); n -= (h * 60 * 60); int m = n / 60, s = (n - (m * 60)); ss <<(h < 10? "0" : "") <<h <<":"; ss <<(m < 10? "0" : "") <<m <<":"; ss <<(s < 10? "0" : "") <<s; cout <<ss.str() <<endl; } int main(){ int h, m, s; while(cin >>h >>m >>s && h != -1){ int sum = s + (m * 60) + (h * 60 * 60); disp(N - sum); disp(N3 - 3 * sum); } return 0; }
#include<iostream> #include<stdio.h> #include<string> #include<math.h> #include<iomanip> #include<algorithm> #include<string.h> #include<cctype> #include<map> #include<set> #include<vector> #include<sstream> #include<stack> #include<queue> #include<deque> #include<functional> #include<utility> using namespace std; int main() { int T,H,S; while(cin>>T>>H>>S&&(T!=-1||H!=-1||S!=-1)) { int kk=3600*T+60*H+S; kk=7200-kk; int kk3=kk*3; string s; int a=kk/3600; int c=kk%60; int b=(kk-a*3600)/60; printf("%02d:%02d:%02d\n",a,b,c); int d=kk3/3600; int f=kk3%60; int e=(kk3-d*3600)/60; printf("%02d:%02d:%02d\n",d,e,f); } //while(1); return 0; }
#include<iostream> #include<cstdio> using namespace std; int main(){ int a[3], b[3], sum, sum3; while(cin >> a[0] >> a[1] >> a[2] && a[0] >= 0) { sum = 120*60 - a[0]*60*60 - a[1]*60 - a[2]; sum3 = sum*3; a[0] = sum/60/60; a[1] = sum/60 - a[0]*60; a[2] = sum - a[0]*60*60 - a[1]*60; b[0] = sum3/60/60; b[1] = sum3/60 - b[0]*60; b[2] = sum3 - b[0]*60*60 - b[1]*60; printf("%02d:%02d:%02d\n", a[0], a[1], a[2]); printf("%02d:%02d:%02d\n", b[0], b[1], b[2]); } return 0; }
#include <iostream> #include <stdio.h> using namespace std; int main(){ int now = 60 * 60 * 2; int hour,minute,second; while(cin>>hour){ now = 60 * 60 * 2; cin>>minute; cin>>second; if(hour==-1 && minute == -1 && second == -1)break; now -= (hour * 60 * 60 + minute * 60 + second); hour = now / (60*60); now %= (60 * 60); minute = now / 60,now%=60; second = now; printf("%02d:%02d:%02d\n",hour,minute,second); hour*=3,minute*=3,second*=3; while(second>=60){ minute++; second-=60; } while(minute>=60){ hour++; minute-=60; } printf("%02d:%02d:%02d\n",hour,minute,second); } } /* Sample Input 1 30 0 -1 -1 -1 Output for the Sample Input 00:30:00 01:30:00 */
#include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #include<string> #include<vector> #include<map> #include<stack> #include<queue> using namespace std; void print(int p){ if(p<10) printf("0"); printf("%d",p); } void print_col(){ printf(":"); } int main(){ int t,h,s; while(scanf("%d %d %d",&t,&h,&s)){ if(t==-1&&h==-1&&s==-1) break; int res=120*60; int t3,h3,s3; s+=h*60+t*3600; s=res-s; s3=s*3; t=s/3600; s=s%3600; h=s/60; s=s%60; // t3=s3/3600; s3=s3%3600; h3=s3/60; s3=s3%60; print(t); print_col(); print(h); print_col(); print(s); printf("\n"); print(t3); print_col(); print(h3); print_col(); print(s3); printf("\n"); } }
#include <iostream> #include <cstdio> using namespace std; int main(){ int h,m,s,dt,dtt,dh,dm,ds,dth,dtm,dts; const int mt = 120 * 60; while(cin >> h >> m >> s){ if(h == -1) break; dt = mt - (3600 * h + 60 * m + s); dtt = 3 * dt; dh = dt / 3600; dt -= 3600 * dh; dm = dt / 60; dt -= 60 * dm; ds = dt; dth = dtt / 3600; dtt -= dth * 3600; dtm = dtt / 60; dtt -= dtm * 60; dts = dtt; printf("%02d:%02d:%02d\n",dh,dm,ds); printf("%02d:%02d:%02d\n",dth,dtm,dts); } return 0; }
#include <iostream> #include <string> #include <cstdio> using namespace std; string encode(int s) { char buf[10]; int h = s / 3600; s -= h * 3600; int m = s / 60; s -= m * 60; sprintf(buf, "%02d:%02d:%02d", h, m, s); return string(buf); } int main() { int h, m, s; while (cin >> h >> m >> s) { if (h == -1 && m == -1 && s == -1) break; int rs = 120 * 60 - h * 3600 - m * 60 - s; int rs_3 = rs * 3; cout << encode(rs) << endl << encode(rs_3) << endl; } return 0; }
#include <iostream> #include <iomanip> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <map> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #define MINUTES 60 #define HOUR 3600 using namespace std; int main() { int h, m, s; while (cin >> h >> m >> s) { if (h == -1 && m == -1 && s == -1) break; int t = 2 * HOUR - (h * HOUR + m * MINUTES + s); printf("%02d:%02d:%02d\n", t / HOUR, (t % HOUR) / MINUTES, (t % HOUR) % MINUTES); t *= 3; printf("%02d:%02d:%02d\n", t / HOUR, (t % HOUR) / MINUTES, (t % HOUR) % MINUTES); } return 0; }
#include <cstdio> using namespace std; int main() { int h, m, s; while (1){ int tmp; int stan, stan_3; scanf("%d %d %d", &h, &m, &s); if (h == -1 && m == -1 && s == -1){ break; } tmp = h * 3600 + m * 60 + s; //printf("tmp=%d\n", tmp); stan = 7200 - tmp; stan_3 = stan * 3; int h_2, m_2, s_2; h_2 = stan / 3600; //printf("h_2 = %d\n", h_2); m_2 = (stan - 3600 * h_2) / 60; s_2 = (stan - 3600 * h_2 - 60 * m_2); //printf("s_2=%d\n", s_2); printf("%02d:%02d:%02d\n", h_2, m_2, s_2); int h_3, m_3, s_3; h_3 = stan_3 / 3600; m_3 = (stan_3 - 3600 * h_3) / 60; s_3 = (stan_3 - 3600 * h_3 - 60 * m_3); printf("%02d:%02d:%02d\n", h_3, m_3, s_3); } return (0); }
#include <iostream> using namespace std; int main(){ int t, h, s; while(cin >> t >> h >> s){ if(t == -1) break; int temp = t * 3600 + h * 60 + s; temp = 7200 - temp; t = temp/3600; h = (temp%3600)/60; s = temp%60; cout << (t/10) << t%10 << ":" << h/10 << h%10 << ":" << s/10 << s%10 << endl; temp *= 3; t = temp/3600; h = (temp%3600)/60; s = temp%60; cout << (t/10) << t%10 << ":" << h/10 << h%10 << ":" << s/10 << s%10 << endl; } return 0; }
#include<iostream> #include<cstdio> using namespace std; int s[3], t[3], u[3], _time, vtime; void printtime(int sec) { printf("%02d:%02d:%02d\n", sec / 3600, (sec / 60) % 60, sec % 60); } int main() { while (true) { cin >> s[0] >> s[1] >> s[2]; if (s[0] == -1) { break; } _time = s[0] * 3600 + s[1] * 60 + s[2]; vtime = 7200; printtime(vtime - _time); printtime(vtime * 3 - _time * 3); } }
#include <cstdio> #include <iostream> using namespace std; int main() { int h, m, s; int t_3; while (scanf("%d%d%d", &h, &m, &s), h != -1){ t_3 = 7200 - (h * 3600 + m * 60 + s); printf("%02d:%02d:%02d\n", t_3 / 3600, t_3 % 3600 / 60, t_3 % 60); t_3 *= 3; printf("%02d:%02d:%02d\n", t_3 / 3600, t_3 % 3600 / 60, t_3 % 60); } return (0); }
#include <iostream> #include <cstdio> using namespace std; #define M (60) #define H (3600) int main() { int h, m, s; while (cin >> h >> m >> s, h != -1, m != -1, s != -1){ int t = 120 * 60; t -= (h * 3600 + m * 60 + s); printf("%02d:%02d:%02d\n", t / H, t % H / M, t % M); t *= 3; printf("%02d:%02d:%02d\n", t / H, t % H / M, t % M); } return (0); }
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main(void){ while(1){ int a=0,b=0,c=0; int d=0,e=0,f=0; cin>>a>>b>>c; if(a==-1)break; c+=a*3600; c+=b*60; c=7200-c; //cout<<"-"<<c<<endl; a=0,b=0; f=3*c; int flg=1; for(;flg==1;){ flg=0; if(c>=3600)a++,c-=3600,flg=1; else if(c>=60)b++,c-=60,flg=1; } printf("%02d:%02d:%02d\n",a,b,c); flg=1; for(;flg==1;){ flg=0; if(f>=3600)d++,f-=3600,flg=1; else if(f>=60)e++,f-=60,flg=1; } printf("%02d:%02d:%02d\n",d,e,f); } return 0; }
#include <iostream> #include <cstdio> using namespace std; #define rep2(x,from,to) for(int x = (from); x < (to); ++(x)) #define rep(x,to) rep2(x,0,to) int main() { int h, m, s; while(cin >> h >> m >> s && (h != -1 || m != -1 || s != -1)) { int second = 2 * 60 * 60 - h * 60 * 60 - m * 60 - s; int tsecond = second * 3; int hour = second / (60 * 60); second -= hour * 60 * 60; int minute = second / 60; second -= minute * 60; int thour = tsecond / (60 * 60); tsecond -= thour * 60 * 60; int tminute = tsecond / 60; tsecond -= tminute * 60; printf("%02d:%02d:%02d\n%02d:%02d:%02d\n", hour, minute, second, thour, tminute, tsecond); } return 0; }
#include<iostream> #include<vector> using namespace std; int main() { vector<int>l; int a; int x, y, z; while (cin >> x >> y >> z) { if (x == -1 && y == -1 && z == -1)break; l.push_back(120 * 60 - z - y * 60 - x * 60 * 60); } for (int i : l) { a = i; int x, y, z; z = a % 60; a -= z; a /= 60; y = a % 60; a -= y; x = a / 60; cout << '0' << x << ':'; if (y >= 10)cout << y << ':'; else cout << '0' << y << ':'; if (z >= 10)cout << z << endl; else cout << '0' << z << endl; a = i * 3; z = a % 60; a -= z; a /= 60; y = a % 60; a -= y; x = a / 60; cout << '0' << x << ':'; if (y >= 10)cout << y << ':'; else cout << '0' << y << ':'; if (z >= 10)cout << z << endl; else cout << '0' << z << endl; } char c; cin >> c; }
#include<stdio.h> int main(void) { int a,aa,b,bb,c,s,ss,sss,s1; int flg1,flg2; scanf("%d %d %d",&a,&b,&c); while(!(a==-1 && b==-1 && c==-1)){ flg1=flg2=0; s=a*3600; ss=b*60; sss=s+ss+c; s1=7200-sss; a=s1/3600; aa=s1%3600; b=aa/60; c=aa%60; printf("%02d:%02d:%02d\n",a,b,c); if(a!=0){ a=a*3; } if(b!=0){ b=b*3; } if(c!=0){ c=c*3; } while(1){ flg1=flg2=0; if(c>=60){ c=c-60; b=b+1; flg1=1; } if(b>=60){ b=b-60; a=a+1; flg2=1; } if(flg1==0 && flg2==0){ break; } } printf("%02d:%02d:%02d\n",a,b,c); scanf("%d %d %d",&a,&b,&c); } return 0; }
#include<stdio.h> int main(){ int h,m,s,s3,m3,h3; while(1){ scanf("%d %d %d",&h,&m,&s); if(h==-1&&m==-1&&s==-1)break; m+=60*h; s+=60*m; s=(120*60)-s; s3=3*s; h=s/3600; h3=s3/3600; s%=3600; s3%=3600; m=s/60; m3=s3/60; s%=60; s3%=60; printf("%02d:%02d:%02d\n%02d:%02d:%02d\n",h,m,s,h3,m3,s3); } return 0; }
#include<iostream> using namespace std; int main(){ int h,m,s; while(cin>>h>>m>>s,h+1){ int left=60*120-h*3600-m*60-s; if(left/3600<10)cout<<0; cout<<left/3600<<':'; if(left/60%60<10)cout<<0; cout<<left/60%60<<':'; if(left%60<10)cout<<0; cout<<left%60<<endl; left*=3; if(left/3600<10)cout<<0; cout<<left/3600<<':'; if(left/60%60<10)cout<<0; cout<<left/60%60<<':'; if(left%60<10)cout<<0; cout<<left%60<<endl; } }
#include <cstdio> using namespace std; int main() { int h,m,s,r1,r3; while(scanf("%d %d %d",&h,&m,&s), h!=-1&&m!=-1&&s!=-1) { r1 = 120*60 - (((h*60)+m)*60+s); r3 = r1*3; printf("%02d:%02d:%02d\n",r1/3600,(r1/60)%60,r1%60); printf("%02d:%02d:%02d\n",r3/3600,(r3/60)%60,r3%60); } }
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int h, m, s; while (cin >> h >> m >> s && (0 <= h)) { int second = 7200 - (h * 3600 + m * 60 + s); int hh, mm, ss; hh = second / 3600; mm = (second % 3600) / 60; ss = second % 60; cout << (10 <= hh ? "" : "0") << hh << ":"; cout << (10 <= mm ? "" : "0") << mm << ":"; cout << (10 <= ss ? "" : "0") << ss << endl; second *= 3; hh = second / 3600; mm = (second % 3600) / 60; ss = second % 60; cout << (10 <= hh ? "" : "0") << hh << ":"; cout << (10 <= mm ? "" : "0") << mm << ":"; cout << (10 <= ss ? "" : "0") << ss << endl; } return 0; }
#include <iostream> using namespace std; const int max_t = 120 * 60; inline int get_time(int h, int m, int s) { return (h * 60 + m) * 60 + s; } void print_time(int t) { int h, m; h = t / 3600; t = t - h * 3600; m = t / 60; t = t - m * 60; cout << '0' << h << ':'; if (m / 10) cout << m << ':'; else cout << '0' << m << ':'; if (t / 10) cout << t << endl; else cout << '0' << t << endl; } int main() { int h, m, s; while (cin >> h >> m >> s, h != -1 || m != -1 || s != -1) { int res = max_t - get_time(h, m, s); print_time(res); print_time(3 * res); } return 0; }
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,t; while(cin>>a>>b>>c,a!=-1){ t=2*3600-a*3600-b*60-c; printf("%02d:%02d:%02d\n",t/3600,(t%3600)/60,t%60); t*=3; printf("%02d:%02d:%02d\n",t/3600,(t%3600)/60,t%60); } }
#include<iostream> #include<cstdio> using namespace std; int main(){ int h,m,s; while(cin>>h>>m>>s,h!=-1){ int rest=2*3600-(h*3600+m*60+s); printf("%02d:%02d:%02d\n", rest/3600, rest%3600/60, rest%60); rest*=3; printf("%02d:%02d:%02d\n", rest/3600, rest%3600/60, rest%60); } return 0; }
#include<iostream> using namespace std; int conv(int h, int m, int s) { return s+m*60+h*60*60; } void reconv(int time, int *h, int *m, int *s) { *h=time/(60*60); time%=60*60; *m=time/60; *s=time%60; } void print(int n) { if(n<10){ cout<<0<<n; } else{ cout<<n; } } int main() { int max=conv(0,120,0); while(1) { int h,m,s; cin>>h>>m>>s; if(h==-1&&m==-1&&s==-1)break; int ans1=max-conv(h,m,s); int ans2=ans1*3; reconv(ans1,&h,&m,&s); print(h); cout<<":"; print(m); cout<<":"; print(s); cout<<endl; reconv(ans2,&h,&m,&s); print(h); cout<<":"; print(m); cout<<":"; print(s); cout<<endl; } }
#include <iostream> #include <iomanip> using namespace std; int main() { int T, H, S; while (true) { cin >> T >> H >> S; if ( T==-1 && H==-1 && S==-1 ) break; int rest = 7200 - 3600*T - 60*H - S; int triple_rest = 3 * rest; cout << setfill('0') << setw(2) << rest/3600 << ":"; rest %= 3600; cout << setfill('0') << setw(2) << rest/60 << ":"; rest %= 60; cout << setfill('0') << setw(2) << rest << endl; cout << setfill('0') << setw(2) << triple_rest/3600 << ":"; triple_rest %= 3600; cout << setfill('0') << setw(2) << triple_rest/60 << ":"; triple_rest %= 60; cout << setfill('0') << setw(2) << triple_rest << endl; } return 0; }
#include<iostream> #include<cstdio> using namespace std; void output(int second){ printf("%02d:",second/60/60); second -= second/60/60*60*60; printf("%02d:",second/60); second -= second/60*60; printf("%02d\n",second); } int main(){ int hour, minutes, second; int allSecond; while(cin >> hour >> minutes >> second, hour+minutes+second!=-3){ second += minutes*60+hour*60*60; allSecond = second; second = 2*60*60 - second; output(second); second = (2*60*60 - allSecond)*3; output(second); } }
#include<iostream> #include<cstdio> using namespace std; int main(){ for(;;){ int a,b,c,s; cin>>a>>b>>c; if(a == -1 && b == -1 && c == -1){break;} s = a*3600+b*60+c; s = 2*60*60-s; printf("%02d:%02d:%02d\n",s/3600,(s%3600)/60,s%60); s*=3; printf("%02d:%02d:%02d\n",s/3600,(s%3600)/60,s%60); } return 0; }
#include<iostream> #include<cstdio> using namespace std; int h,m,s; int main(){ while(1){ cin>>h>>m>>s; if(h==-1&&m==-1&&s==-1) break; int sec = h*3600 + m*60 + s; int ans1 = 3600*2 - sec; int ans2 = ans1*3; printf("%02d:%02d:%02d\n", ans1/3600, ans1%3600/60, ans1%60 ); printf("%02d:%02d:%02d\n", ans2/3600, ans2%3600/60, ans2%60); } return 0; }
#include <iostream> #include <iomanip> int main() { int h, m, s; int rest; while( 1) { std::cin >> h >> m >> s; if(h==-1 && m==-1 && s==-1) break; // Calculate Remaining Time rest = 7200 - ( h*3600 + m*60 + s); std::cout << std::setw(2) << std::setfill('0') << (rest/3600) << ":" << std::setw(2) << std::setfill('0') << ( (rest%3600) / 60 ) << ":" << std::setw(2) << std::setfill('0') << (rest%60) << std::endl; std::cout << std::setw(2) << std::setfill('0') << ((rest*3)/3600) << ":" << std::setw(2) << std::setfill('0') << ( ((rest*3)%3600) / 60 ) << ":" << std::setw(2) << std::setfill('0') << ((rest*3)%60) << std::endl; } return 0; }
#include <iostream> #include <stdio.h> #include <math.h> using namespace std; int main() { int h,m,s,i,g; while(cin >> h >> m >> s) { if (h+m+s==-3) break; g=s=7200-(3600*h+60*m+s); for (i=0;i<2;i++) { h=s/3600; s-=h*3600; m=s/60; s-=m*60; printf("%.2d:%.2d:%.2d\n",h,m,s); s=g*3; } } return 0; }
#include <bits/stdc++.h> #define rep(i,a,n) for(int i=a;i<n;i++) #define repr(i,a,n) for(int i=a;i>=n;i--) #define INF 999999999 #define INF_M 2147483647 #define pb(a) push_back(a) using namespace std; typedef pair<int, int> pii; typedef long long int ll; int main() { int t,h,s; while(cin >> t >> h >> s) { if(t == -1 && h == -1 && s == -1) break; int temp = 7200 - (3600 * t + 60 * h + s); int a,b,c; a = temp / 3600; b = temp / 60 % 60; c = temp % 60; printf("%02d:%02d:%02d\n",a,b,c); temp *= 3; a = temp / 3600; b = temp / 60 % 60; c = temp % 60; printf("%02d:%02d:%02d\n",a,b,c); } return 0; }
#include <iostream> #include <cstdio> int main(void){ int h,m,s,h3,m3,s3; int t,t3; while(std::cin>>h>>m>>s,h!=-1||m!=-1||s!=-1){ t=7200; t=t-(h*3600+m*60+s); t3=t*3; h=t/3600;t%=3600;h3=t3/3600;t3%=3600; m=t/60;t%=60;m3=t3/60;t3%=60; s=t;s3=t3; printf("%02d:%02d:%02d\n",h,m,s); printf("%02d:%02d:%02d\n",h3,m3,s3); } return 0; }
#include <stdio.h> #include <iostream> using namespace std; int main() { int h,m,s; int time; int nokori,nokori3; while (1) { cin >> h >> m >> s; if (h == -1 && m == -1 && s == -1) { break; } time = 3600 * h + 60 * m + s; nokori = 7200 - time; nokori3 = nokori * 3; printf("%02d:",nokori/3600); nokori %= 3600; printf("%02d:",nokori/60); nokori %= 60; printf("%02d\n",nokori); printf("%02d:",nokori3/3600); nokori3 %= 3600; printf("%02d:",nokori3/60); nokori3 %= 60; printf("%02d\n",nokori3); } return 0; }
//53 #include<iostream> using namespace std; int main(){ for(int L;cin>>L,L;){ int m=0; for(int i=1;i<=12;i++){ int M,N; cin>>M>>N; L-=M-N; if(m==0&&L<=0){ m=i; } } if(m){ cout<<m<<endl; }else{ cout<<"NA"<<endl; } } return 0; }
#include<iostream> using namespace std; int main() { int l; while (cin >> l&&l != 0) { int m = 0, n = 0, g=10000; bool h = false; for (int i = 0; i < 12; i++) { int a, b; cin >> a >> b; a -= b; m++; n += a; if (n >= l&&h == false) { g = m;h = true; } } if (g == 10000) cout << "NA" << endl; else { cout << g << endl; } } }
#include<iostream> using namespace std; int main(){ int l,m,n; while(true){ cin >> l; if(!l)break; int f = 1; for(int i=0;i<12;i++){ cin >> m >> n; l -= m-n; if(l<=0 && f){ cout << i+1 << endl; f = 0; } } if(l>0)cout << "NA" << endl; } return 0; }