問題文
请复制&粘贴以下程序,并在指定位置追加程序以解决问题。
#include <bits/stdc++.h>
using namespace std;
int main() {
// 一年の秒数
int seconds = 365 * 24 * 60 * 60;
// 以下のコメント/* */を消して追記する
cout << /* 1年は何秒か */ << endl;
cout << /* 2年は何秒か */ << endl;
cout << /* 5年は何秒か */ << endl;
cout << /* 10年は何秒か */ << endl;
}
int型变量seconds表示一年的秒数。利用它
- 1年有多少秒
- 2年有多少秒
- 5年有多少秒
- 10年有多少秒
请顺序一行一行地显示。
不需要考虑闰秒或闰年。
执行结果(部分用“?????”隐藏)
31536000 63072000 ????? ?????
解答例
请务必自己尝试问题之后再查看。
在kurikku查看解答例
#include <bits/stdc++.h>
using namespace std;
int main() {
// 一年の秒数
int seconds = 365 * 24 * 60 * 60;
// 以下のコメントを消して追記する
cout << seconds << endl;
cout << seconds * 2 << endl;
cout << seconds * 5 << endl;
cout << seconds * 10 << endl;
}