CodeForces - 816A Karen and Morning(阅读题)
2017-08-23 21:17
330 查看
题目大意:
给你一个时间,问你至少再过多长时间,才能变成一个回文数。代码:
#include<bits/stdc++.h> using namespace std; char s[10]={0}; int main() { scanf("%s",s); int a,b,c,d; a=s[0]-'0'; b=s[1]-'0'; c=s[3]-'0'; d=s[4]-'0'; int num=0; while(1) { if(a==d&&b==c)break; //cout<<a<<" "<<b<<c<<d<<endl; num++; d++; if(d>=10) { d=0; c++; if(c>=6) { c=0; b++; if(b>=10) { b=0;a++; } if(a*10+b>=24) { a=0;b=0; } } } } printf("%d",num); }
相关文章推荐
- CodeForces - 821B Okabe and Banana Trees(阅读题)
- CodeForces 825A Multi-judge Solving(阅读题)
- codeforces 558C 分类: codeforces 2015-08-08 14:15 9人阅读 评论(0) 收藏
- codeforces 546E 分类: codeforces 2015-05-27 20:33 36人阅读 评论(0) 收藏
- CodeForces - 817A Treasure Hunt(阅读题)
- CodeForces - 817B Makes And The Product(阅读题)
- codeforces 366D 分类: codeforces 2015-08-09 17:38 9人阅读 评论(0) 收藏
- codeforces #310 div2 D 分类: codeforces 2015-06-29 20:03 29人阅读 评论(0) 收藏
- CodeForces - 818A Diplomas and Certificates(阅读题)
- CodeForces - 820A Mister B and Book Reading(阅读题)
- CodeForces - 822A I'm bored with life(阅读题)
- CodeForces 315E - Sereja and Subsequences 阅读理解+树状数组
- codeforces 438D 分类: codeforces 2015-03-28 10:18 38人阅读 评论(0) 收藏
- CodeForces - 835A Key races(阅读题)
- codeforces #309 div2 分类: codeforces 2015-06-26 20:11 21人阅读 评论(0) 收藏
- CodeForces - 835B The number on the board(阅读题)
- CodeForces - 821A Okabe and Future Gadget Laboratory(阅读题)
- 【codeforces】378BParade(简单思维+英语阅读理解-.-)
- codeforces 842 A. Kirill And The Game(阅读题)
- CodeForces - 822B Crossword solving(阅读题)