fork download
  1. #include <stdio.h>//第3講問1
  2. #include <stdlib.h>
  3.  
  4. void read_map(){
  5. int ch;
  6. FILE*fp;
  7. fp=fopen("map.txt","rt");
  8. if(fp==NULL){
  9. perror("ファイルを開けない.");
  10. exit(1);
  11. }
  12. while( (ch=fgetc(fp)) != -1){
  13. printf("%c",ch);
  14. }
  15. }
  16. void main (){
  17. read_map();
  18. }
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
Standard output is empty