trojanxem

beta

Dec 5th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.11 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <windows.h>
  4.  
  5. # define TMAX 20
  6.  
  7. using namespace std;
  8. struct punkty{
  9.         double x, y;
  10.         char wyraz[TMAX];
  11.  
  12. };
  13.  
  14. int main()
  15. {
  16.     punkty Lista[TMAX];
  17.     char liczba[4][3];
  18.     char pomocnicza[4][3];
  19.     ifstream plik("zrodlo.txt");
  20.     for(int i = 0; i < 4; i++)
  21.         for(int j = 0; j < 3; j++)
  22.             plik >> liczba[i][j];
  23.  
  24.             for(int i = 0; i < 4; i++)
  25.         for(int j = 0; j < 3; j++)
  26.             if(liczba[i][j] > 48 && liczba[i][j] < 57)
  27.             {
  28.                 pomocnicza[i][j] = liczba[i][j];
  29.             }
  30.             else
  31.             {
  32.                 *Lista[i].wyraz =liczba[i][j];
  33.             }
  34.  
  35.  
  36.  
  37.             //do - nothing
  38.  
  39.     for(int i = 0; i < 4; i++)
  40.     {
  41.         for(int j = 0; j < 3; j++)
  42.              if(pomocnicza[i][j] > 48 && pomocnicza[i][j] < 57)
  43.              {
  44.                  cout << pomocnicza[i][j] << " ";
  45.         cout << "\n";
  46.              }
  47.  
  48.         else
  49.             cout << Lista[i].wyraz << " ";
  50.         cout << "\n";
  51.     }
  52.  
  53.     system("pause");
  54.     return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment