Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- struct robot{
- int x;
- int y;
- };
- void wypisz(robot *wsk, int nn)
- {
- for(int i=0; i<nn; i++)
- {
- cout<<wsk[i].x <<" "<<wsk[i].y<<endl;
- }
- }
- int main()
- {
- string nazwa;
- cin>>nazwa;
- fstream plikin;
- plikin.open(nazwa.c_str(), ios::in);
- if(!plikin)
- {
- cout<<"brak";
- return 0;
- }
- int a;
- plikin>>a;//nasze "n"
- robot *robocik=new robot[a];
- for(int i=0; i<a; i++)
- {
- plikin>>robocik[i].x;
- plikin>>robocik[i].y;
- }
- wypisz(robocik, a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement