Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <windows.h>
- # define TMAX 20
- using namespace std;
- struct punkty{
- double x, y;
- char wyraz[TMAX];
- };
- int main()
- {
- punkty Lista[TMAX];
- char liczba[4][3];
- char pomocnicza[4][3];
- ifstream plik("zrodlo.txt");
- for(int i = 0; i < 4; i++)
- for(int j = 0; j < 3; j++)
- plik >> liczba[i][j];
- for(int i = 0; i < 4; i++)
- for(int j = 0; j < 3; j++)
- if(liczba[i][j] > 48 && liczba[i][j] < 57)
- {
- pomocnicza[i][j] = liczba[i][j];
- }
- else
- {
- *Lista[i].wyraz =liczba[i][j];
- }
- //do - nothing
- for(int i = 0; i < 4; i++)
- {
- for(int j = 0; j < 3; j++)
- if(pomocnicza[i][j] > 48 && pomocnicza[i][j] < 57)
- {
- cout << pomocnicza[i][j] << " ";
- cout << "\n";
- }
- else
- cout << Lista[i].wyraz << " ";
- cout << "\n";
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment