teempe

Untitled

Jun 7th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include <fstream>
  4.  
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.     /*
  9.     format pliku to
  10.     '
  11.     1 2 32 1392 73 213
  12.     9 23 4 1 874 9 0
  13.     '
  14.     odstepy to spacja
  15.     */
  16.  
  17.     fstream *F( "C:\\Users\\diler\\Desktop\\aha", ios::in);
  18.     char * _w = NULL, _a;
  19.     int _contuer, _kol;
  20.  
  21.     if(F.good())
  22.     {
  23.         _a = F.get(); // znak pobieramy
  24.         if( _a == '\n' ) _kol = counter; //ilość kolumn
  25.         else if( _a != ' ') ++_contuer; // liczymy ile znakow ma plik  
  26.     }
  27.     cout << _counter << endl << _kol << endl;
  28.     int *_tab = new int [_kol][_counter];
  29.  
  30.  
  31.     F.close();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment