《高级语言程序设计实践》期末考试复现——3 今晚深渊结算

 1 #include<iostream>
 2 using namespace std;
 3 int main()
 4 {
 5     int a,b;
 6     cin>>b>>a;
 7     switch(b)
 8     {
 9         case 12:a+=2;
10         case 11:a+=3;
11         case 10:a+=2;
12         case 9:a+=3;
13         case 8:a+=3;
14         case 7:a+=2;
15         case 6:a+=3;
16         case 5:a+=2;
17         case 4:a+=3;
18         case 3:a+=1;
19         case 2:a+=3;
20     }
21     a%=7;
22     if(a==1||a==5) cout<<"YES";
23     else cout<<"NO";
24 }

 

posted @ 2020-03-03 14:20  Miaohengming  阅读(170)  评论(0编辑  收藏  举报