(HDU)1491-- Octorber 21st (校庆)
生活随笔
收集整理的這篇文章主要介紹了
(HDU)1491-- Octorber 21st (校庆)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
題目鏈接:https://vjudge.net/problem/HDU-1491
1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <iostream> 5 #include <algorithm> 6 #include <string> 7 #include <cstdlib> 8 9 using namespace std; 10 11 int main() 12 { 13 int a[11]={0,31,28,31,30,31,30,31,31,30}; 14 int t; 15 while(cin>>t) 16 { 17 for(int i=0;i<t;i++) 18 { 19 int sum=0; 20 int n,m; 21 scanf("%d %d",&n,&m); 22 if(((n==10)&&(m>21))||n>10) printf("What a pity, it has passed!\n"); 23 else if(n==10&&m==21) printf("It's today!!\n"); 24 else 25 { 26 for(int i=n;i<10;i++) 27 sum+=a[i]; 28 sum=sum+21-m; 29 printf("%d\n",sum); 30 } 31 } 32 } 33 return 0; 34 }?
轉載于:https://www.cnblogs.com/ACDoge/p/6141534.html
總結
以上是生活随笔為你收集整理的(HDU)1491-- Octorber 21st (校庆)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: js获取浏览器语言(ie、ff、chro
- 下一篇: Java 代码完成删除文件、文件夹操作