Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- using namespace std;
- struct point {
- string name;
- int x;
- int y;
- } points [5];
- void printPoint (point point);
- int main ()
- {
- string names;
- int n;
- for (n=0; n<5; n++)
- {
- cout << "Podaj nazwe punktu: " << "\n";
- getline (cin,points[n].name);
- cout << "Podaj X" << "\n";
- cin >> points[n].x;
- cout << "Podaj Y" << "\n";
- cin >> points[n].y;
- getline (cin,names);
- }
- cout << "\nWprowadziłeś następujące punkty :\n";
- for (n=0; n<5; n++)
- printPoint (points[n]);
- return 0;
- }
- void printPoint (point point)
- {
- cout << point.name;
- cout << " (X=" << point.x << ",Y= " << point.y << ")\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement