#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 <iostream>
using namespace std;
int main(){ cout << "Vvedute kol-vo ocenok" << endl;
int n,i,a,Four,Five; n = i = a = Four = Five = 0;
cin >> n;
for (i = 1; i <= n; i++) { cin >> a; if (a == 4){ Four++;} else if (a == 5) { Five++; } } if (Four > Five){ cout << "Four" << endl;} else if (Five > Four) { cout << "Five" << endl; } else { cout << "Equal"<< endl; } cout << "Kol-vo 4: " << Four << " Kol-vo 5: " << Five << endl; 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;
}
Объяснение: