Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h> //Импортируем библиотеку для исп. функции возведения в степень pow()
- using namespace std;
- /*
- 2
- int main() {
- int x, y, z;
- cin >> x >> y >> z;
- if (x % 2 == 0){
- cout << x << ' ';
- }
- if (y % 2 == 0){
- cout << y << ' ';
- }
- if (z % 2 == 0){
- cout << z << ' ';
- }
- if ((x % 2 != 0) && (z % 2 != 0) && (y % 2 != 0)){
- cout << "No even numbers";
- }
- return 0;
- }
- 3
- int main() {
- int x, y, z;
- cin >> x >> y >> z;
- if ((x > y) && (x > z)){
- cout << x*x;
- }
- if ((y > x) && (y > z)){
- cout << y*y;
- }
- if ((z > y) && (z > x)){
- cout << z*z;
- }
- }
- 4
- int main() {
- int x, y;
- cin >> x >> y;
- if (x % y == 0){
- cout << "Y";
- }
- else {
- cout << "N";
- }
- }
- 5
- int main(){
- int x, y, SumOfSq, SqOfSum;
- cin >> x >> y;
- SqOfSum = (x + y)*(x + y);
- SumOfSq = x*x + y*y;
- if (SqOfSum >= SumOfSq){
- cout << SqOfSum;
- }
- else{
- cout << SumOfSq;
- }
- return 0;
- }
- 6
- int main(){
- int x, n1, n2, n3, n4;
- cin >> x;
- n4 = x % 10;
- n3 = x % 100;
- n2 = x % 1000;
- n1 = x % 10000;
- if ((n4 + n1) > (n3 + n2)){
- cout << "Middle";
- }
- else {
- cout << "Angles";
- }
- return 0;
- }
- 7
- */
- int main(){
- int x, y;
- cin >> x >> y;
- if (y > 0){
- if (x > 0){
- cout << "1";
- }
- if (x < 0){
- cout << "2";
- }
- }
- if (y < 0){
- if (x > 0){
- cout << "4";
- }
- if (x < 0){
- cout << "3";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement