fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. FILE *fpi,*fpo;
  6. char s[20];
  7. int a,b,c;
  8.  
  9. fpi=fopen("sdata.txt","r");
  10. fpo=fopen("odata2.txt","w");
  11.  
  12. while(fscanf(fpi,"%s %d %d",s,&a,&b)!=EOF) {
  13. c=a*b;
  14. fprintf(stdout,"%s %d\n",s,c);
  15. fprintf(fpo,"%s %d\n",s,c);
  16. }
  17.  
  18. return 0;
  19. }
Runtime error #stdin #stdout 0.02s 1848KB
stdin
Standard input is empty
stdout
Standard output is empty