解题思路:
注意事项:
参考代码:
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
switch(a)
{
case 1:
cout<<b<<endl; break;
case 2:
cout<<b+31<<endl; break;
case 3:
cout<<b+31+28<<endl; break;
case 4:
cout<<b+31*2+28<<endl; break;
case 5:
cout<<b+31*2+28+30<<endl; break;
case 6:
cout<<b+31*3+28+30<<endl; break;
case 7:
cout<<b+31*3+28+30*2<<endl; break;
case 8:
cout<<b+31*4+28+30*2<<endl; break;
case 9:
cout<<b+31*5+28+30*2<<endl; break;
case 10:
cout<<b+31*5+28+30*3<<endl; break;
case 11:
cout<<b+31*6+28+30*3<<endl; break;
case 12:
cout<<b+31*6+28+30*4<<endl; break;
}
return 0;
}
0.0分
0 人评分