竞赛
考级
#include <stdio.h> int main() { int n; do { scanf("%d", &n); if (n < 0) { printf("请输入大于零的数"); } } while (n < 0); while (n >= 7) { n -= 7; } switch (n) { case 0: printf("monday"); break; case 1: printf("tuesday"); break; case 2: printf("wednesday"); break; case 3: printf("thursday"); break; case 4: printf("friday"); break; case 5: printf("saturday"); break; case 6: printf("sunday"); break; } return 0; }
199****3693
复仇者_黑客_摆烂崽
186****8957
#include<iostream> using namespace std; int main(){ int n; cin >> n; n = (n + 1) % 7; if(n == 1) cout << "monday"; else if(n == 2) cout << "tuesday"; else if(n == 3) cout << "wednesday"; else if(n == 4) cout << "thursday"; else if(n == 5) cout << "friday"; else if(n == 6) cout << "saturday"; else if(n == 0) cout << "sunday"; return 0; }
༺ཌༀ爱向自己ༀད༻
6.
禁止抄袭
xzr
#include <bits/stdc++.h> using namespace std; int main (){ int a; cin >> a; if (a % 7 == 0 )cout << "monday"; else if(a % 7 == 1)cout << "tuesday"; else if(a % 7 ==2)cout << "wednesday"; else if(a % 7 == 3)cout << "thursday"; else if(a % 7 == 4)cout << "friday"; else if(a % 7 == 5)cout << "saturday"; else if(a % 7 == 6)cout << "sunday"; return 0; }
133****3799
通过char数组存星期英文,再通过if语句进行判断,是程序达到题目要求
Feanaze
#include<bits/stdc++.h> using namespace std; int main(){ string lst[7]={"monday","tuesday","wednesday","thursday","friday","saturday","sunday"}; int n; cin>>n; if((n+1)%7==0)cout<<lst[6]; else cout<<lst[(n+1)%7-1]; }
qqq
卢督庭
私密马赛
四大Tian王
#include<iostream> using namespace std; int main(){ int n; cin>>n; n=(n+1)%7; if(n1){ cout<<"monday"; } else if(n2){ cout<<"tuesday"; } else if(n3){ cout<<"wednesday"; } else if(n4){ cout<<"thursday"; } else if(n5){ cout<<"friday"; } else if(n6){ cout<< "saturday"; } else if(n==0){ cout<< "sunday"; } return 0; }
DEMO
#include <iostream> using namespace std; int main(){ int a; cin>>a; a=(a+1)%7; if(a1){ cout<<"monday"<<endl; }else if(a2){ cout<<"tuesday"<<endl; }else if(a3){ cout<<"wednesday"<<endl; }else if(a4){ cout<<"thursday"<<endl; }else if(a5){ cout<<"friday"<<endl; }else if(a6){ cout<<"saturday"<<endl; }else{ cout<<"sunday"<<endl; } return 0;
王子豪
#include <iostream> using namespace std; int main(){ int n; cin>>n; n=(n+1)%7; switch (n) { case 1: cout<<"monday";break; case 2: cout<<"tuesday";break; case 3: cout<<"wednesday";break; case 4: cout<<"thursday";break; case 5: cout<<"friday";break; case 6: cout<<"saturday";break; case 0: cout<<"sunday";break; } }
屑小M
#include<iostream> using namespace std; int main(){ int n; cin >> n; n = (n + 1) % 7; if(n == 1){ cout << "monday"; } else if(n == 2){ cout << "tuesday"; } else if(n == 3){ cout << "wednesday"; } else if(n == 4){ cout << "thursday"; } else if(n == 5){ cout << "friday"; } else if(n == 6){ cout << "saturday"; } else if(n == 0){ cout << "sunday"; } return 0; }
许肄霄
正在减肥的吃货
majmDZB
AC谢云龙
|#include<cstdio> #include<iostream> #include<cmath> using namespace std; int main(){ int a; cin >> a; a%=7; switch(a) { case 0:cout << "monday";break; case 1:cout <<"tuesday";break; case 2:cout << "wednesday";break; case 3:cout <<"thursday";break; case 4:cout << "friday";break; case 5:cout <<"saturday";break; case 6:cout << "sunday";break; } return 0; }
Zด้้้้้็้้้้้้้็
共62条