90#4有问题,求解!

P5690 [CSP-S2019 江西] 日期

希望更丰富的展现?使用Markdown ```plain ```cpp code ```。 ```
by CGDGAD @ 2020-10-29 18:13:01


话说最近问这道题的咋这么多啊/fad
by CGDGAD @ 2020-10-29 18:13:29


@[NSObject](/user/357545) 心血来潮(bushi
by Xiang_MR @ 2020-10-29 18:18:06


```cpp #include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #include <cmath> #include <list> #include <map> using namespace std; int month[15] = {0 ,31 ,28 ,31 ,30 ,31 ,30 ,31 ,31 ,30 ,31 ,30 ,31}; int main() { int a ,b ,t = 0; char c; cin >> a >> c >> b; if(a > 12 && a % 10 != 2 && a % 10 != 0) { t++; a %= 10; if(a > 0 && a < 20) a = 12; } else if(a % 10 == 2 && a != 12) a = 12 ,t++; else if(a % 10 == 0 && a != 10) a = 10, t++; if(b > month[a] || b <= 0) t++; cout << t << endl; return 0; } ``` 可以参考一下……
by xiaogao @ 2020-11-15 21:44:52


@[Xiang_MR](/user/190152) 加一句“if(s[0] == 1) s[1] = 2”就行了
by xiaogao @ 2020-11-15 21:53:25


@[xiaogao](/user/182645) 谢谢大佬!(火星救援www)
by Xiang_MR @ 2020-11-25 16:10:45


|