题解 | #牛牛的一周#

牛牛的一周

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].

全部评论

相关推荐

人间雪:简历最好只要一页,除非你牛逼到一页都写不下了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务