Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //
- //
- #include <cstdio>
- #include <cstdlib>
- #include <cctype>
- int main(){
- FILE* f = fopen("C:/Users/User/Desktop/C++/text/text1.txt", "r+");
- char array[250];
- int i, a=0;
- char number_array[250];
- if (f==0) printf("Error");
- else{
- if (fgets(array, 250, f) != NULL)
- puts(array);
- fclose(f);
- }
- for(i=0;i<250;i++){
- if(isdigit(array[i])){
- number_array[a] = array[i];
- a++;
- }
- }
- printf("\n");
- printf("%s", number_array);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement