#include <iostream> using namespace std; int main() { setlocale(0,""); int a; cout<<"введите значение погоды"<<endl; cout<<"1-тепло"<<endl; cout<<"2-жарко"<<endl; cout<<"3-холодно"<<endl; cout<<"4-колотун"<<endl; cin>>a; switch (a) { case 1: cout<<"вы можете одеть джинсы и футболку"<<endl; break; case 2: cout<<"вы можете одеть шорты и майку "<<endl; break; case 3: cout<<"вы можете одеть штаны и толстовку "<<endl; break; case 4: cout<<"вы можете одеть куртку и свитер с подштанниками и ватными штанми "<<endl; break; } return 0; }
#include <iostream>
#include<vector>
using namespace std;
int square(int x){
for (int i = 1; i <= 45; ++i){
if (i * i <= x){
continue;
}
return (i - 1) * (i - 1);
}
}
int main()
{
int x, y, xwas, ywas, xywas;
cin >> x >> y;
xwas = square(x);
ywas = square(y);
xywas = square(x + y);
if (xwas + ywas < xywas){
cout << "Petya gives paint to Vasya";
}
else if (xwas + ywas == xywas){
cout << "Equal";
}
else {
cout << "Petya leaves paint to himself";
}
return 0;
}#include <iostream>
#include<vector>
using namespace std;
int square(int x){
for (int i = 1; i <= 45; ++i){
if (i * i <= x){
continue;
}
return (i - 1) * (i - 1);
}
}
int main()
{
int x, y, xwas, ywas, xywas;
cin >> x >> y;
xwas = square(x);
ywas = square(y);
xywas = square(x + y);
if (xwas + ywas < xywas){
cout << "Petya gives paint to Vasya";
}
else if (xwas + ywas == xywas){
cout << "Equal";
}
else {
cout << "Petya leaves paint to himself";
}
return 0;
}
Объяснение: