65 条题解
-
0
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if(n == 1)//进行4次判断,来确定输出。 { cout << "swim"; } if(n == 5) { cout << "read"; } if(n == 3) { cout << "program"; } if(n == 6) { cout << "math"; } if(n == 2 or n == 4 or n == 7)//这里如果用else,会出错,因为会把rest追加到program和read末尾。 { cout << "rest"; } return 0; }
-
0
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if(n == 1)//判断各个项目,并输出指定词语 { cout << "swim"; } if(n == 3) { cout << "program"; } if(n == 5) { cout << "read"; } if(n == 6) { cout << "math"; } if(n == 2 or n == 4 or n == 7) { cout << "rest"; } return 0; }
-
0
傻瓜式做法:
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n == 1) { cout << "swim"; } if (n == 3) { cout << "program"; } if (n == 5) { cout << "read"; } if (n == 6) { cout << "math"; } if (n == 2 or n == 4 or n == 7) { cout << "rest"; } return 0; }
正确做法
#include <iostream> using namespace std; int main() { cout << "I don't know!" return 0; }
信息
- ID
- 666
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- 4
- 标签
- 递交数
- 8405
- 已通过
- 3903
- 上传者