不想敲(星期几)单词的这边请
2024-02-22 18:17:16
发布于:广东
9阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,sum;
cin>>n;
if(n <= 6) sum = 1+n;
else sum = n%7+1;
if(sum == 1) cout<<"monday";
else if(sum == 2) cout<<"tuesday";
else if(sum == 3) cout<<"wednesday";
else if(sum == 4) cout<<"thursday";
else if(sum == 5) cout<<"friday";
else if(sum == 6) cout<<"saturday";
else if(sum == 7) cout<<"sunday";
return 0;
}
全部评论 1
me too
1周前 来自 浙江
0
有帮助,赞一个