#include
Void the sort (int [] s)
{
int t;
for(int i=0; S [I]!='\ 0'; I++)
For (int j=I + 1; S [j].='\ 0'; J++)
If (s [I]
T=s [I];
S [j] [I]=s;
S [j]=t;
}
}
Int main ()
{
Int n, m;
Int a [3005], [1005] b;
While (the scanf (" % d % d ", & amp; N, & amp; M)!=(EOF)
{
for(int i=0; i
Int k=0;
for(int i=0; i
k++;
}
Sort (b);
for(int i=0; i
printf("\n");
}
}
CodePudding user response:
# include
//void the sort (int [] s)
Void the sort (int [s], int len)
{
int t;
//for (int I=0; S [I]!='\ 0'; I++)
for(int i=0; I & lt; Len. I++)
//for (int j=I + 1; S [j].='\ 0'; J++)
For (int j=I + 1; J & lt; Len. J++)
If (s [I]{
T=s [I];
S [j] [I]=s;
S [j]=t;
}
}
Int main ()
{
Int n, m;
Int a [3005], [1005] b;
While (the scanf (" % d % d ", & amp; N, & amp; M)!=(EOF)
{
for(int i=0; iThe scanf (" % d ", & amp; A [I]);
Int k=0;
for(int i=0; iFor (int j=I + 1; J B=a [I] + [k] a [j];
k++;
}
//sort (b);
Sort (b, k);
for(int i=0; iPrintf (" % d, b [I]);
printf("\n");
}
}
For your reference ~
The original poster is confused, '\ 0' is the end of the string tag, not int the end of an integer
CodePudding user response:
The