#include <stdio.h>
int c[10000]={0};
int main()
{
int n; int i,x=0;
FILE *a=fopen("a.txt","r"),*b=fopen("b.txt","w");
while(fscanf(a,"%d%*c",&n)!=EOF) c[n]++,x++;
for(i=0;i<10000;i++)
{
if(c[i])
while(c[i]--) x--,fprintf(b,"%d%c",i,x ? ',' : 0);
}
fclose(a);
fclose(b);
return 0;
}
int c[10000]={0};
int main()
{
int n; int i,x=0;
FILE *a=fopen("a.txt","r"),*b=fopen("b.txt","w");
while(fscanf(a,"%d%*c",&n)!=EOF) c[n]++,x++;
for(i=0;i<10000;i++)
{
if(c[i])
while(c[i]--) x--,fprintf(b,"%d%c",i,x ? ',' : 0);
}
fclose(a);
fclose(b);
return 0;
}
My Blog: www.aiexp.info
虽然我的路是从这里开始的,但是这里不再是乐土.感谢曾经影响过,引导过,帮助过我的董凯,飞燕,leeco,starwing,Rockcarry,soft_wind等等等等.别了,BCCN.