fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. FILE *fp;
  6. char yomi[20];
  7. char kanji[20];
  8.  
  9. fp = fopen("data.txt", "r");
  10. if(fp == NULL) {
  11. printf("error");
  12. return -1;
  13. }
  14.  
  15. while(fscanf(fp, "%s%s", kanji, yomi) != EOF) {
  16. printf("%s %s\n", yomi, kanji);
  17. }
  18.  
  19. fclose(fp);
  20. return 0;
  21. }
Runtime error #stdin #stdout 0s 2184KB
stdin
Standard input is empty
stdout
error