题解 | #牛牛的一周#
牛牛的一周
https://www.nowcoder.com/practice/5394d88a8fa042d99e3b9be34e17ad71
#include <iostream>
#include <string>
using namespace std;
int main() {
string a[7]={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
int b;
while (cin >> b) { // 注意 while 处理多个 case
cout<<a[b-1];
//printf("%s",a[b-1].c_str())
}
}
// 64 位输出请用 printf("%lld")
注意区分cout与printf对于字符串数组的用法 如果是cout可以直接用str[1].
查看20道真题和解析