Advertisement
eimkasp

C++ End of line

Nov 25th, 2011
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     ifstream fd("Duomenys.txt");
  8.     char a[256];
  9.     int paz[30][500];
  10.     string temp;
  11.     int j= 0, n = 1;
  12.     while(!fd.eof()) {
  13.         j++;
  14.         n = 1;
  15.         fd.getline(a,256); 
  16.         temp = a;
  17.         for (int i = 0; i <= temp.size(); i++){
  18.             if(temp[i]-48 == -48)
  19.             {
  20.             break;
  21.             }
  22.             else if (temp[i] != ' ')
  23.             {
  24.             paz[j][n] = temp[i]-48;
  25.             cout << paz[j][n] << endl;
  26.             n++;
  27.             }
  28.     }
  29.         cout << "naujas masyvas" << endl;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement