杭电1491Octorber 21st(数学) 忘是亡心i 2022-08-17 14:25 12阅读 0赞 # Octorber 21st # **Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)** Total Submission(s): 3688 Accepted Submission(s): 2268 Problem Description HDU's 50th birthday, on Octorber 21st, is coming. What an exciting day!! As a student of HDU, I always want to know how many days are there between today and Octorber 21st.So, write a problem and tell me the answer.Of course, the date I give you is always in 2006. ![c48-1001-1.jpg][] Input The input consists of T test cases. The number of T is given on the first line of the input file.Following T lines, which represent dates, one date per line. The format for a date is "month day" where month is a number between 1 (which indicates January) and 12 (which indicates December), day is a number between 1 and 31.All the date in the input are in 2006, you can assume that all the dates in the input are legal(合法). Output For each case, if the date is before Octorber 21st, you should print a number that between the date and Octorber 21st.If the day is beyond Octorber 21st, just print "What a pity, it has passed!".If the date is just Octorber 21st, print"It's today!!". Sample Input 7 10 20 10 19 10 1 10 21 9 1 11 11 12 12 Sample Output 1 2 20 It's today!! 50 What a pity, it has passed! What a pity, it has passed! 简单数学题! #include<cstring> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main() { int m,n,i,j,M,a[12]={0,31,28,31,30,31,30,31,31,30,31}; scanf("%d",&M); int sum=0; while(M--) { scanf("%d%d",&m,&n); if(m>10||(m==10&&n>21)) printf("What a pity, it has passed!\n"); else { if(m==10) { if(n==21) { printf("It's today!!\n"); continue; } else{ printf("%d\n",21-n); continue; } } sum=a[m]-n; for(i=m+1;i<10;i++) sum+=a[i]; sum+=21; printf("%d\n",sum); } } return 0; } [c48-1001-1.jpg]: /images/20220731/43920a47c52f4304914a5d6697aa1a02.png
相关 杭电ACM基础题(1408、1412、1418、1420、1465、1491、1555) 文章目录 1408、滴完一瓶盐水所需要的时间 1412、\{A\} + \{B\} 1418、欧拉公式 1420、求 叁歲伎倆/ 2023年07月19日 10:59/ 0 赞/ 9 阅读
相关 杭电1061 Rightmost Digit Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (J 布满荆棘的人生/ 2022年09月17日 05:27/ 0 赞/ 283 阅读
相关 杭电1491Octorber 21st(数学) Octorber 21st Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Jav 忘是亡心i/ 2022年08月17日 14:25/ 0 赞/ 13 阅读
相关 杭电1039 Easier Done Than Said? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 6553 一时失言乱红尘/ 2022年06月05日 12:48/ 0 赞/ 287 阅读
相关 杭电1026 Ignatius and the Princess I Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 6553 快来打我*/ 2022年06月04日 05:53/ 0 赞/ 306 阅读
相关 杭电oj Problem Title 1 Pro. ID 1000 A+B Problem include<stdio.h> int main() { £神魔★判官ぃ/ 2022年05月15日 16:14/ 0 赞/ 335 阅读
相关 杭电1060 此题是一道数学题,也是一道技巧题,也是不能直接算的,否则会超时的!!! 此题思路: 设n^n=d.xxxx\10^(k-1),其中k表示n^n的位数; d.xxxx 痛定思痛。/ 2021年12月01日 22:40/ 0 赞/ 326 阅读
相关 杭电2075 此题真的是简单的再不能简单了!呵呵!我一直纠结,出这样的题是什么意思呢?不懂!哎,不说那些废话了,直接 ac吧!呵呵! \include<iostream> using 今天药忘吃喽~/ 2021年12月01日 22:38/ 0 赞/ 311 阅读
相关 杭电2078 说实话,此题是一道有严重bug的问题,对于xhd没晚能复习的科目数m根本就没用上!!!哎不管那么些了,反正ac了!呵呵!此题这样想xhd得复习效率是前一课程和后一课程复习效率差 ╰+攻爆jí腚メ/ 2021年12月01日 22:38/ 0 赞/ 356 阅读
相关 杭电2090 此题就是一道令人无法琢磨的题!哎!!我简直就无语了!!呵呵!竟然能出这题。。。。 废话少说,直接ac!!! \\\ 此题要想输出结果,还需要注意一下! 在linux 约定不等于承诺〃/ 2021年12月01日 21:12/ 0 赞/ 370 阅读
还没有评论,来说两句吧...