daily pastebin goal
9%
SHARE
TWEET

2018_12_12

a guest Dec 12th, 2018 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4.  
  5.  
  6. //txt  dat
  7.  
  8. using namespace std;
  9.  
  10. int main()
  11.  
  12. {
  13.     fstream f;
  14.     int i=1;
  15.  
  16.     f.open("test.txt",ios::out);
  17.      for(i=1; i<=100; i++){
  18.         f<<i<<" "<<i*i<<" "<<i*i*i<<endl;
  19.      }
  20.  
  21.     f.close();
  22.     int E[100];
  23.     int N[100];
  24.     int H[100];
  25.     f.open("test.txt",ios::in);
  26.     for(i=0;i<100;i++){
  27.         f>>E[i];
  28.         f>>N[i];
  29.         f>>H[i];
  30.     }
  31.     cout<< H[99];
  32.     i=0;
  33.     while( !f.eof() ){
  34.         f>>E[i];
  35.         f>>N[i];
  36.         f>>H[i];
  37.         i++;
  38.     }
  39.    
  40.    
  41.    
  42.     f.close();
  43.  
  44.     return 0;
  45. }
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