Home > Back-end >  Teach me QAQ pintia dalao
Teach me QAQ pintia dalao

Time:11-16








# include
Int main ()
{
Int I, j, temp1, temp2, count=0;
Int a [10]={0}, b [10]={0};
for(i=0; i<10; I++)
The scanf (" % d ", & a [I]);//2200123
for(i=0; i<10; I++)
{
If (a [I]!=0)
{
Temp1=a, [I].//2
Temp2=I;//1
for(j=1; J <=temp1; J++)
{
B [count]=temp2;
count++;
}
}
}
Int sum;
for(i=0; i<10; I++)
Sum=sum + a [I];
int temp;
For (I=the sum of 1, temp=0; i>0; I -)
{
If (b [I] {
Temp=b [I];
B=b [I] [I - 1);
B] [I - 1=temp;
}
}

for(i=1; I {
For (j=sum - 1; J> I; J -)
{
If (b [j] {
Temp=b [I];
B=b [I] [I - 1);
B] [I - 1=temp;
}
}
}
for(i=0; I Printf (" % d, b [I]);

return 0;
}
  • Related