trojanxem

Untitled

Dec 5th, 2013
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 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.         {
  43.             if(pomocnicza[i][j] > 48 && pomocnicza[i][j] < 57)
  44.                   cout << pomocnicza[i][j] << " ";
  45.         }
  46.         cout << "\n";
  47.  
  48.  
  49.  
  50.     }
  51.  
  52.     for(int i = 0 ; i < 4 ; i++)
  53.     if(*Lista[i].wyraz >= 65 && *Lista[i].wyraz <= 90)
  54.         cout << *Lista[i].wyraz;
  55.         cout << "\n";
  56.  
  57.  
  58.     system("pause");
  59.     return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment