rishat06

2_8

Sep 16th, 2025
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | Source Code | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.     double x, y;
  7.     cout << "Введите координаты (x y): ";
  8.     cin >> x >> y;
  9.    
  10.     double distance = sqrt(x*x + y*y);
  11.     int points = 0;
  12.    
  13.     if (distance <= 2.0) {
  14.         points = 10;
  15.     } else if (distance <= 4.0) {
  16.         points = 5;
  17.     } else if (distance > 4.0) {
  18.         points = 0;
  19.     }
  20.    
  21.     cout << "Выбито очков: " << points << endl;
  22.    
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment