SHARE
TWEET

Untitled

a guest Jul 18th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //
  3. //
  4.  
  5. #include <cstdio>
  6. #include <cstdlib>
  7. #include <cctype>
  8.  
  9. int main(){
  10. FILE* f = fopen("C:/Users/User/Desktop/C++/text/text1.txt", "r+");
  11. char array[250];
  12. int i, a=0;
  13. char number_array[250];
  14. if (f==0) printf("Error");
  15. else{
  16.     if (fgets(array, 250, f) != NULL)
  17.         puts(array);
  18.         fclose(f);
  19. }
  20. for(i=0;i<250;i++){
  21.     if(isdigit(array[i])){
  22.         number_array[a] = array[i];
  23.         a++;
  24.     }  
  25. }
  26. printf("\n");
  27. printf("%s", number_array);
  28. return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top