shiyan9.1.cpp
来自「模仿港台《百万富翁》节目」· C++ 代码 · 共 29 行
CPP
29 行
#include<iostream.h>
struct count
{
int year;
int month;
int day;
};
void main()
{
int month[13]={0,31,0,31,30,31,30,31,31,30,31,30,31};
int sum=0;
count today;
cin>>today.year>>today.month>>today.day;
if((today.year%100!=0)&&(today.year%4==0)||(today.year%400==0))
month[2]=29;
else
month[2]=28;
for(int i=1;i<today.month;i++)
sum+=month[i];
sum+=today.day;
cout<<sum<<endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?