建议用下面语句创建1.txt文件:
ofstream fout("1.txt"); for(j = 0;j <= i;j++) fout << 每个数据间用空格隔开。读出时,格式与“写”类似: ifstream fin("1.txt"); for(j = 0;j <= i;j++) fin >> name[j] >> round[j] >> countright[j] >> score[j] >> etime[j]; 原来的空格作为分隔符,fin语句中不需要显式给出。
每个数据间用空格隔开。读出时,格式与“写”类似:
ifstream fin("1.txt"); for(j = 0;j <= i;j++) fin >> name[j] >> round[j] >> countright[j] >> score[j] >> etime[j];
原来的空格作为分隔符,fin语句中不需要显式给出。