Files
ZUT-notatki/uczelnia/2_semestr/programowanie/laby/lab3/zad2.cpp
2026-03-17 16:03:58 +01:00

24 lines
336 B
C++

#include <iostream>
class Punkt {
int x, y;
public:
void ustaw(int x, int y) {
this->x = x;
this->y = y;
}
void pokaz() { std::cout << '(' << x << ',' << y << ')' << std::endl; }
};
int main() {
int x, y;
std::cout << "Podaj x i y: ";
std::cin >> x;
std::cin >> y;
Punkt p;
p.ustaw(x, y);
p.pokaz();
}