帮我看看哪错了
#include <iostream.h>#include <fstream.h>
#include <stdlib.h>
#include <math.h>
void main()
{ ifstream infile;
ifstream read;
char temp[200];
char num=0;
char s;
infile.open("F:\\wsx\\surf-mon-1.out" ios::in);
while(read)
{
read.getline(temp,200);
read.getline(temp,200);
num++;
read.get(s);
read.get(s);
read.get(s);
read.get(s);
char string[17]={0};
read.getline(string,17);
p= strtok(string," ");
while(p !=NULL)
{
a[i]=atof(p);
p=strtok(NULL," ");
}
int i,sum;
for(i=0;i<223;i++)
sum+=a[i];
sum/=222;
return sum;
ofstream outfile;
outfile.open("F:\\wsx\\text.out");
}
infile.close();
outfile.close();
}
读取一个文件 读掉文件的前两行 读掉文件的前四个字符 然后算平均值 求大神指导 初学者