i++
有以下程序
#include
main()
{
int s[12]={1,2,3,4,4,3,2,1,1,1,2,3},c[5]={0},i;
for(i=0; i<12; i++)
c[s[i]]++;
for(i=1; i<5; i++)
printf("%d ",c[i]);
printf("\n");
}
程序的运行结果是
有以下程序
#include
main()
{ FILE *fp; int i, a[6] = {1,2,3,4,5,6};
fp = fopen( "d2.dat", "w+" );
for (i=0; i<6; i++) fprintf( fp, "%d\n", a[i] );
rewind( fp );
for ( i=0; i<6; i++ ) fscanf( fp, "%d", &a[5-i] );
fclose(fp);
for ( i=0; i<6; i++ ) printf( "%d,", a[i] );
}
程序运行后输出结果是