作业帮 > 综合 > 作业

C语言输入一个正整数N和N个整数,将它们中的偶数按从大到小的顺序进行排序后输出.

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/04/27 13:39:34
C语言输入一个正整数N和N个整数,将它们中的偶数按从大到小的顺序进行排序后输出.
Input
多组测试数据,每组输入一个正整数N(1≤N≤100)和N个整数,用空格分隔.
Output
将这N个数中的偶数按从大到小的顺序输出
Sample Input
10 8 4 14 2 11 30 40 500 17 100
8 80 200 99 -12 34 55 88 11
Sample Output
500 100 40 30 14 8 4 2
200 88 80 34 -12
HINT
#include "stdio.h"
int main()
{
int cnt;
int i,j,max,n;
int s[100];
int buf[100];
printf("please enter number\n");
scanf("%d",&cnt);
printf("please enter %d the byte\n",cnt);
for(i=0;i