请问dalao们,代码哪里错了啊

P1046 [NOIP2005 普及组] 陶陶摘苹果

q0q0 @ 2021-09-09 22:22:31

#include<iostream>

using namespace std;

int main(){
    int apples[10];
    int high;
    int numA=0;

    cin>>high;
    high=high+30;

    for(int i=0;i<10;i++){
        cin>>apples[i];
    }

    for(int i=0;i<10;i++){
         if(apples[i]<=high)
            numA++;

    }

    cout<<numA;

return 0;
}

by Eason_AC @ 2021-09-09 22:26:52

@张宇墨是伞兵 是先要输入苹果的高度再输入陶陶的高度……


by lion0514 @ 2021-09-09 22:29:00

@张宇墨是伞兵 伞兵不容污名!建议改名!

还有highapple[i]的输入顺序反了,请仔细读题好吧


by Danny_SCQ @ 2021-09-09 22:33:28

@张宇墨是伞兵 输入输反了,好像数组有可能越界吧


by lion0514 @ 2021-09-09 22:34:26

@Eason_AC %%%


by songxiao @ 2021-09-09 22:37:49

@张宇墨


by songxiao @ 2021-09-09 22:38:03

@zhangyumo


by tlzhy @ 2021-09-09 22:58:09

哈,伞兵总是散着看病


by q0q0 @ 2021-09-10 17:58:47

@I_am_gone__ 张宇墨是本人,从小想当跳伞运动员—v—


by q0q0 @ 2021-09-10 17:59:13

@Gorilla 张宇墨是本人,从小想当跳伞运动员—v—


by q0q0 @ 2021-09-10 18:08:40

[doge]


| 下一页