#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
using namespace std;
//b.txt
//12, wd, wr, sd, sf, 34.5676
//23, er, df, xc, xc, 12.234
int main(void)
{
FILE *fp = fopen("b.txt", "rt");
while (!feof(fp))
{
int nAge = 0;
double dGrade = 0.0;
fscanf(fp, "%d,%[a-zA-Z],%[a-zA-Z],%[a-zA-Z],%[a-zA-Z],%lf", &nAge, chB, chC, chD, chE, &dGrade);
printf("%d\n", nAge);
printf("%s\n", chB);
printf("%s\n", chC);
printf("%s\n", chD);
printf("%s\n", chE);
printf("%f\n", dGrade);
}
system("pause");
return 0;
}
#include <iostream>
#include <stdio.h>
using namespace std;
//b.txt
//12, wd, wr, sd, sf, 34.5676
//23, er, df, xc, xc, 12.234
int main(void)
{
FILE *fp = fopen("b.txt", "rt");
while (!feof(fp))
{
int nAge = 0;
double dGrade = 0.0;
fscanf(fp, "%d,%[a-zA-Z],%[a-zA-Z],%[a-zA-Z],%[a-zA-Z],%lf", &nAge, chB, chC, chD, chE, &dGrade);
printf("%d\n", nAge);
printf("%s\n", chB);
printf("%s\n", chC);
printf("%s\n", chD);
printf("%s\n", chE);
printf("%f\n", dGrade);
}
system("pause");
return 0;
}