trojanxem

Untitled

Dec 5th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.75 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <windows.h>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     char liczba[4][3];
  10.     char pomocnicza[4][3];
  11.     ifstream plik("zrodlo.txt");
  12.     for(int i = 0; i < 4; i++)
  13.         for(int j = 0; j < 3; j++)
  14.             plik >> liczba[i][j];
  15.  
  16.             for(int i = 0; i < 4; i++)
  17.         for(int j = 0; j < 3; j++)
  18.             if(liczba[i][j] > 48 && liczba[i][j] < 57)
  19.             pomocnicza[i][j] = liczba[i][j];
  20.  
  21.  
  22.             //do - nothing
  23.  
  24.     for(int i = 0; i < 4; i++)
  25.     {
  26.         for(int j = 0; j < 3; j++)
  27.              if(pomocnicza[i][j] > 48 && pomocnicza[i][j] < 57)
  28.             cout << pomocnicza[i][j] << " ";
  29.         cout << "\n";
  30.     }
  31.  
  32.     system("pause");
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment