Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <iomanip>
- #include <cmath>
- using namespace std;
- struct xy
- {
- int x,y,nr,x1,y1;
- };
- void skaitymas(xy ma[],int &n)
- {
- ifstream fd("test.txt");
- fd>>ma[0].x>>ma[0].y;
- fd>>ma[1].x>>ma[1].y;
- fd>>n;
- for(int i=0;i<n;i++)
- {
- fd>>ma[i].nr;
- for(int j=0;j<ma[i].nr;j++)
- {
- fd>>ma[j].x1;
- //cout<<ma[j].x1<<endl;
- }
- }
- }
- void skaiciavimas(xy ma[],int &n)
- {
- for(int i=0;i<n;i++)
- {
- for(int j=0;j<ma[i].nr;j++)
- {
- cout<<ma[j].x1<<endl;
- }
- cout<<" "<<endl;
- }
- }
- int main()
- {
- xy ma[250];int n;
- skaitymas(ma,n);
- skaiciavimas(ma,n);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement