003Doinb @ 2023-11-03 02:16:23
#include<iostream>
using namespace std;
int main()
{
int arr[9], i, a,b,sum=0;
for (i = 0; i <=9;i++)
{
cin >> a;
a = arr[i];
}
cin >> b;
b = b + 30;
for (i = 0; i <=9; i++)
{
if (arr[i] < b )
{
sum++;
}
}
cout << sum << endl;
## }
by Virtual_Character @ 2023-11-03 06:57:16
数组开太小了 @003Doinb
by 003Doinb @ 2023-11-03 22:05:09
@Virtual_Character 你好 你的意思是定义时的数组改大点吗 我改成一百以后只有最后一步正确
by 003Doinb @ 2023-11-04 00:07:36
我知道了 我把a和arr赋值时候弄反了 反回来之后只有最后一步是错了。。。
by 1531rzh @ 2023-11-05 22:56:00
还有等于的情况,下面for循环的if里要加个=
by 003Doinb @ 2023-11-15 16:36:49
@1531rzh 好的 实在是多谢!