重拾C++从输入输出开始
#include <iostream>
using namespace std;
int main()
{
cout << "请输入年份:";
int x;
cin >> x;
if (x % 4 == 0)
cout << x << "年是闰年。"<<endl;
else
cout << x << "年不是闰年。"<<endl;
return 0;
}
就上面这个我还查了下要不要用namespace std 😃
一开始还打的是 cout << x + “年是闰年。”; 结果跑不出来 😃
我是个辣鸡 😃