自己写的switch case 100
2024-10-20 15:07:49
发布于:广东
0阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main () {
int m,d;
cin >> m >> d;
switch(m) {
case 1: case 3: case 5: case 7: case 8: case 10: case 12:
if (d % 2 != 0) {
cout << "Play!";
break;
}else {
cout << "Oh!No!";
break;
}
case 2: case 4: case 6: case 9: case 11:
if (d % 2 != 0) {
cout << "Oh!No!";
break;
}else {
cout << "Play!";
break;
}
}
return 0;
}
这里空空如也
有帮助,赞一个