Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- struct node
- {
- char s[10];
- char s1[10];
- double arr[9];
- };
- struct node name[10];
- int main()
- {
- int i=0,j,a[10]={0};
- FILE *f;
- f=fopen("b10315020.txt","r");
- while((a[i]=fscanf(f,"%s %s ",name[i].s,name[i].s1))!=EOF)
- {
- printf("\n%s %s ",name[i].s,name[i].s1);
- for(j=0;j<9;j++)
- {
- fscanf(f,"%lf",&name[i].arr[j]);
- printf("%.2lf ",name[i].arr[j]);
- }
- i++;
- }
- fclose(f);
- printf("\n\n");
- for(j=0;j<9;j++)
- printf("%d ",a[j]);
- printf("\n");
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement