Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main() {
- double x, y;
- cout << "Введите координаты (x y): ";
- cin >> x >> y;
- double distance = sqrt(x*x + y*y);
- int points = 0;
- if (distance <= 2.0) {
- points = 10;
- } else if (distance <= 4.0) {
- points = 5;
- } else if (distance > 4.0) {
- points = 0;
- }
- cout << "Выбито очков: " << points << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment