Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. int isGood(const char *filename) {
  2. FILE *f = fopen(filename, "r");
  3.  
  4. if( !f )
  5. return 0;
  6.  
  7. int c;
  8.  
  9. while( (c = fgetc(f)) != EOF ) {
  10. if( c == '\n' || c == '\r' )
  11. continue;
  12.  
  13. if( c <= '0' || c >= '9' )
  14. return 0;
  15. }
  16.  
  17. fclose(f);
  18.  
  19. return 1;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement