_ipad @ 2024-12-18 19:47:10
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, a[100], b;
cin >> n;
for (int i = 0; i < n; i ++)
{
cin >> a[i];
if (a[i] % 10 - a[i] / 10 % 10 - a[i] / 10 / 10 % 10 - a[i] / 10 / 10 / 10 % 10 > 0)
{
b += 1;
}
}
cout << b;
return 0;
}
by _ipad @ 2024-12-18 20:05:15
@Mr_Terminator怎么不会交了?
by Mr_Terminator @ 2024-12-18 20:06:27
*,开完隐了。抱歉
by Mr_Terminator @ 2024-12-18 20:07:54
@_ipad 局部变量 b 没有初始化值(它可以是任何奇形怪状的东西)
可以把 int b 挪到 int main 外
初始化 b=0
by _ipad @ 2024-12-18 20:22:36
@Mr_Terminator哦对了,我刚才吧O2优化关了就通过了。
by Mr_Terminator @ 2024-12-18 20:24:16
6