#include <stdio.h>
void main ()
{
int c, n, l, sl, a;
c=1;
n=0;
l=0;
sl=0;
while (c<=10)
{
printf ("enter ten numbers");
scanf ("%d", &n);
c++;
if (n>sl){
sl=n;
if (sl>l)
{a=sl;sl=l;l=a;}}}
printf ("the larger is %d\n", sl);
printf ("the largest is %d\n",l);
}
这个可以了
void main ()
{
int c, n, l, sl, a;
c=1;
n=0;
l=0;
sl=0;
while (c<=10)
{
printf ("enter ten numbers");
scanf ("%d", &n);
c++;
if (n>sl){
sl=n;
if (sl>l)
{a=sl;sl=l;l=a;}}}
printf ("the larger is %d\n", sl);
printf ("the largest is %d\n",l);
}
这个可以了