Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language xiaobai, seek the source program (it is best to explain each line of code)
C language xiaobai, seek the source program (it is best to explain each line of code)
# include & ltstdio.h & gt

Integer count (integer n)

{

int cnt

for(CNT = 0; n; n/= 10)

if(n% 10==3)

cnt++;

Return cnt

}

void sort(int a[],int n)

{

int i,j,t;

for(I = 0; I<n-1; ++i)

{

for(j = 0; j & ltn-I- 1; ++j)

{

if(count(a[j])& lt; count(a[j+ 1])

{

t = a[j];

a[j]= a[j+ 1];

a[j+ 1]= t;

}

}

}

}

int main()

{

int a[3],I;

for(I = 0; I<3; ++i)

scanf("%d ",& ampa[I]);

sort(a,3);

for(I = 0; I<3; ++i)

printf("%d ",a[I]);

Returns 0;

}