解题思路:
注意事项:
参考代码:
#include <iostream>
using namespace std;
int main()
{
int n,y,r,i;
cin>>n>>y>>r;
switch(y)
{
case 1:i=r;break;
case 2:i=31+r;break;
case 3:i=31+28+r;break;
case 4:i=31+28+31+r;break;
case 5:i=31+28+31+30+r;break;
case 6:i=31+28+31+30+31+r;break;
case 7:i=31+28+31+30+31+30+r;break;
case 8:i=31+28+31+30+31+30+31+r;break;
case 9:i=31+28+31+30+31+30+31+31+r;break;
case 10:i=31+28+31+30+31+30+31+31+30+r;break;
case 11:i=31+28+31+30+31+30+31+31+30+31+r;break;
case 12:i=31+28+31+30+31+30+31+31+30+31+30+r;break;
}
if((n%4==0&&n%100!=0)||(n%400==0))
if(y>=3) i=i+1;
cout<<i<<endl;
return 0;
}
0.0分
0 人评分
【绝对值排序】 (C语言代码)浏览:717 |
字符串对比 (C语言代码)浏览:1413 |
输出正反三角形 (C语言代码)格式错误!!!浏览:1141 |
C语言训练-阶乘和数* (C语言代码)-------- 呆板写法浏览:1362 |
C语言训练-求s=a+aa+aaa+aaaa+aa...a的值 (C语言代码)浏览:691 |
【金明的预算方案】 (C++代码)浏览:843 |
C语言考试练习题_一元二次方程 (C语言代码)浏览:576 |
【蟠桃记】 (C语言代码)浏览:1035 |
三角形 (C语言代码)浏览:914 |
回文数字 (C语言代码)浏览:2510 |