Advertisement
Technoblade777

Classwork 12.09.22

Sep 12th, 2022 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.78 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h> //Импортируем библиотеку для исп. функции возведения в степень pow()
  3. using namespace std;
  4.  
  5.  
  6. /*
  7. 2
  8. int main() {
  9.     int x, y, z;
  10.     cin >> x >> y >> z;
  11.     if (x % 2 == 0){
  12.         cout << x << ' ';
  13.     }
  14.     if (y % 2 == 0){
  15.         cout << y << ' ';
  16.     }
  17.     if (z % 2 == 0){
  18.         cout << z << ' ';
  19.     }
  20.     if ((x % 2 != 0) && (z % 2 != 0) && (y % 2 != 0)){
  21.         cout << "No even numbers";
  22.     }
  23.    
  24.     return 0;
  25. }
  26. 3
  27. int main() {
  28.     int x, y, z;
  29.     cin >> x >> y >> z;
  30.     if ((x > y) && (x > z)){
  31.         cout << x*x;
  32.     }
  33.     if ((y > x) && (y > z)){
  34.         cout << y*y;
  35.     }
  36.     if ((z > y) && (z > x)){
  37.         cout << z*z;
  38.     }
  39. }
  40.  
  41. 4
  42. int main() {
  43.     int x, y;
  44.     cin >> x >> y;
  45.     if (x % y == 0){
  46.         cout << "Y";
  47.     }
  48.     else {
  49.         cout << "N";
  50.     }
  51.    
  52. }
  53.  
  54. 5
  55. int main(){
  56.     int x, y, SumOfSq, SqOfSum;
  57.     cin >> x >> y;
  58.     SqOfSum = (x + y)*(x + y);
  59.     SumOfSq = x*x + y*y;
  60.     if (SqOfSum >= SumOfSq){
  61.         cout << SqOfSum;
  62.     }
  63.     else{
  64.         cout << SumOfSq;
  65.     }
  66.     return 0;
  67.  
  68. }
  69. 6
  70. int main(){
  71.     int x, n1, n2, n3, n4;
  72.     cin >> x;
  73.     n4 = x % 10;
  74.     n3 = x % 100;
  75.     n2 = x % 1000;
  76.     n1 = x % 10000;
  77.     if ((n4 + n1) > (n3 + n2)){
  78.         cout << "Middle";
  79.     }
  80.     else {
  81.         cout << "Angles";
  82.     }
  83.     return 0;
  84. }
  85.  
  86. 7
  87. */
  88. int main(){
  89.     int x, y;
  90.     cin >> x >> y;
  91.     if (y > 0){
  92.         if (x > 0){
  93.             cout << "1";
  94.         }
  95.         if (x < 0){
  96.             cout << "2";
  97.         }
  98.     }
  99.     if (y < 0){
  100.         if (x > 0){
  101.             cout << "4";
  102.         }
  103.         if (x < 0){
  104.             cout << "3";
  105.         }
  106.     }
  107.  
  108.     return 0;
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement