Public paste
asdf
By: asd | Date: Dec 6 2006 18:05 | Format: C++ | Expires: never | Size: 662 B | Hits: 1299

  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6.  
  7.  
  8.  
  9. int main()
  10. {
  11.  
  12.     ifstream infile;
  13.     ofstream outfile;
  14.     infile.open("indata7.txt");
  15.     outfile.open("outdata7.txt");      
  16.     const int SIZE = 15;
  17.     int grades[SIZE];
  18.     int i;
  19.     int max = 0;
  20.    
  21.    
  22.     for(i = 0;i <= SIZE; i++)
  23.    
  24.     {
  25.          
  26.      infile >> grades[i];
  27.      
  28.      
  29.      
  30.      if (grades[i]>max)
  31.      max = grades[i];
  32.      }
  33.      
  34.    
  35.    
  36.     for(i = 0;i <= SIZE; i++)
  37.     outfile << " " << grades[i];
  38.     outfile <<endl;
  39.     outfile << max;        
  40.    
  41.  
  42.  
  43.     system("PAUSE");
  44.     return 0;
  45. }
  46.