Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. void wykonajOperacje( int liczba1, char, int liczba2 )
  7. {
  8.     cout << liczba1 << " , " << liczba2 << " -> " << liczba1*liczba1 << " , " << liczba2*liczba2 << endl;
  9.    
  10. }
  11.  
  12. void wczytajPlik()
  13. {
  14.     ifstream plik;
  15.     plik.open( "wektory.txt");
  16.        
  17.         int a;
  18.         char b;
  19.         int c;
  20.        
  21.        
  22.    do {
  23.         plik >> a >> b >> c;
  24.         if( plik.good() )
  25.         wykonajOperacje( a, b, c );
  26.        
  27. }
  28. while(!plik.eof());
  29.  
  30.      plik.close();
  31. }
  32.  
  33. int main()
  34. {
  35.     wczytajPlik();
  36.  
  37.     system("PAUSE");
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement