eclipse sdk做网站,邯郸技术服务类,网站建设又叫什么软件,做水处理药剂的公司网站第一行输入人数n#xff0c;第二行输入每个人的成绩#xff0c;用空格分开。输出所有成绩中的最高分和最低分。
输入格式:
第一行输入n#xff0c;大于0的整数#xff1b;第二行输入n个大于等于0#xff0c;小于等于100的整数#xff0c;用空格分开。
输出格式:
最高…第一行输入人数n第二行输入每个人的成绩用空格分开。输出所有成绩中的最高分和最低分。
输入格式:
第一行输入n大于0的整数第二行输入n个大于等于0小于等于100的整数用空格分开。
输出格式:
最高分和最低分用空格分开。
#include stdio.h
#include stdlib.h int main() { int n; scanf(%d, n); int *scores (int *)malloc(n * sizeof(int)); for (int i 0; i n; i) { scanf(%d, scores[i]); } int max_score scores[0]; int min_score scores[0]; for (int i 1; i n; i) { if (scores[i] max_score) { max_score scores[i]; } if (scores[i] min_score) { min_score scores[i]; } } printf(%d %d\n, max_score, min_score); free(scores); return 0;
}