输入10个数。求最大的两个数。怎么这样做不正确啊
#include <stdio.h>int main ()
{
int counter, largest, number,largest2;
counter = 1;
printf("请输入10个整数:");
scanf("%d", &number);
largest = number;
largest2 = number;
while (counter <= 9)
{
counter++;
printf("请输入10个整数:");
scanf("%d", &number);
if (largest < number)
largest = number;
if (largest2 < largest)
largest2 = number;
}
printf("最大的两个数是%d\t%d\n", largest, largest2);
return 0;
}