?? test7_3.txt
字號(hào):
#include <sys/types.h>
#include <stdio.h>
int main(void)
{
float value, total[10];
int count, label;
FILE *fp;
for(count=0; count<10; count++)
total[count]=0;
if(!(fp=fopen("test.dat", "r")))
{
printf("Error in open file.\n");
exit(1);
}
while(!fscanf(fp, "%d%g", &label, &value))
{
total[label]+=value;
}
for(count=0; count<10; count++)
{
printf("%d: %f\n", count, total[count]);
return 0;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -