4.定义一个有10个元素的数组,用其代表10个学生的考试成绩,从键盘输入10个成绩,分别统计优、良

日期:2018-05-09 10:26:24 人气:1

4.定义一个有10个元素的数组,用其代表10个学生的考试成绩,从键盘输入10个成绩,分别统计优、良

#include #include #define N 10using namespace std;int main(){ float arr[N]={0.0}; int i,cnt[11]={0}; srand((unsigned)time(NULL));//随机种子初始化,方便测试 for(i=0;i!=N;++i){ arr[i]=rand()%10000/100.0; //用随机数作为输入,方便测试 //cin&g
    A+
热门评论