Shagovikova08
03.11.2022 12:48

с информатикой. Нужно выбрать несколько вариантов ответа​

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
SupercellTV
11.09.2021 03:41

#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;

}

Объяснение:

0,0(0 оценок)
Ответ:
кирилл2124
02.05.2020 01:41

#include lt;iostreamgt;

#include lt;cstringgt;

#include lt;vectorgt;

#include lt;algorithmgt;

struct StudentData

{

std::string name;

std::string surname;

int math;

int phys;

int comp_science;

};

bool

comp(const StudentData amp;a, const StudentData amp;b)

{

int tmp1 = a.math + a.phys + a.comp_science;

int tmp2 = b.math + b.phys + b.comp_science;

return tmp1 gt; tmp2 true : false;

}

int

main(void)

{

int n;

std::cin gt;gt; n;

std::vectorlt; StudentData gt; data(n);

for (int i = 0; i lt; n; i++) {

std::cin gt;gt; data[i].name gt;gt; data[i].surname;

std::cin gt;gt; data[i].math gt;gt; data[i].phys gt;gt; data[i].comp_science;

}

std::sort(data.begin(), data.end(), comp);

for (int i = 0; i lt; n; i++) {

std::cout lt;lt; data[i].name lt;lt; " " lt;lt; data[i].surname lt;lt; std::endl;

}

return 0;

}

Объяснение:

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота