#include <iostream>using namespace std;int main(){ int a,s,d,f; setlocale(0,""); cout<<endl<<"Введите возраст Коли:"; cin>>a; cout<<endl<<"Введите возраст Миши:"; cin>>s; if (a>s && a>0 && s>0) { d=a-s; f=(a+s)/2; cout<<endl<<"Коля старше Миши на: "<<d<<" лет"<<endl; cout<<"Средний возраст ребят: "<<f<<" лет"<<endl; } if (a<s && a>0 && s>0) { d=s-a; f=(a+s)/2; cout<<endl<<"Миша старше Коли на: "<<d<<" лет"<<endl; cout<<endl<<"Средний возраст ребят: "<<f<<" лет"<<endl; } if (a<0 || s<0) { cout<<endl<<"Вы ввели отрицательное число"<<endl; } system ("pause"); return 0;}