首页上一页 1 下一页尾页 1 条记录 1/1页
程序闪退
发表在C语言图书答疑
2016-03-31
是否精华
是
否
版块置顶:
是
否
#include "stdafx.h"
#include "iostream"
using namespace std;
int main(int argc, _TCHAR* argv[])
{
int year;
cout << "输入年份:" <<"\n";
cout << "year = ";
cin >> year;
if (year % 4 == 0)
{
if (year%100 !=0)
{
cout << year << "年是闺年" << "\n";
}
else if (year%400 == 0)
{
cout << year << "年是闺年" << "\n";
}
else
{
cout << year << "年不是闺年" << "\n";
}
}
else
{
cout << year << "年不是闺年" << "\n";
}
}
#include "iostream"
using namespace std;
int main(int argc, _TCHAR* argv[])
{
int year;
cout << "输入年份:" <<"\n";
cout << "year = ";
cin >> year;
if (year % 4 == 0)
{
if (year%100 !=0)
{
cout << year << "年是闺年" << "\n";
}
else if (year%400 == 0)
{
cout << year << "年是闺年" << "\n";
}
else
{
cout << year << "年不是闺年" << "\n";
}
}
else
{
cout << year << "年不是闺年" << "\n";
}
}