#include<stdio.h>
int main(){
int zuiDaShu,ciDaShu,shuZu[9999],a,b;
printf("请输入您要比较的数字的个数,按下回车确认\n");
scanf("%d",&b);
a=b;
printf("请输入您要比较的数中间用空格隔开,按下回车确认。\n");
while(0<a){
scanf("%d",&shuZu[a-1]);
--a;
}
zuiDaShu=shuZu[0];
while(a<b){
if(zuiDaShu<shuZu[a]) zuiDaShu=shuZu[a];
++a;
}
ciDaShu=-1;
while(0<=a){
if(ciDaShu<shuZu[a]&&shuZu[a]!=zuiDaShu) ciDaShu=shuZu[a];
--a;
}
printf("最大数%d 次大数%d",zuiDaShu,ciDaShu);
}
int main(){
int zuiDaShu,ciDaShu,shuZu[9999],a,b;
printf("请输入您要比较的数字的个数,按下回车确认\n");
scanf("%d",&b);
a=b;
printf("请输入您要比较的数中间用空格隔开,按下回车确认。\n");
while(0<a){
scanf("%d",&shuZu[a-1]);
--a;
}
zuiDaShu=shuZu[0];
while(a<b){
if(zuiDaShu<shuZu[a]) zuiDaShu=shuZu[a];
++a;
}
ciDaShu=-1;
while(0<=a){
if(ciDaShu<shuZu[a]&&shuZu[a]!=zuiDaShu) ciDaShu=shuZu[a];
--a;
}
printf("最大数%d 次大数%d",zuiDaShu,ciDaShu);
}