#include <iostream>
int getMax(int a, int b, int c)
{
if (a>b) return a;
if (c>b) return c;
return b;
}
int main()
{
int a,b,c;
std::cout << "a="; std::cin >> a;
std::cout << "b="; std::cin >> b;
std::cout << "c="; std::cin >> c;
std::cout << getMax(a,b,c);
return 0;
}
#include <iostream>
bool seSimplifica(int a, int b, int k)
{
return (a%k==0&&b%k==0);
}
int main()
{
int a,b,k;
std::cout << "a="; std::cin >> a;
std::cout << "b="; std::cin >> b;
std::cout << "k="; std::cin >> k;
if (seSimplifica(a,b,k)) {
std::cout << "se simplifica";
} else {
std::cout << "nu se simplifica";
}
return 0;
}
#include <iostream>
int main()
{
int a,b;
std::cout << "cati ani are primul copil? "; std::cin >> a;
std::cout << "cati ani are al doilea copil? "; std::cin >> b;
if (a>b){
std::cout << "primul copil este mai mare cu " << a - b << " ani";
} else {
std::cout << "al doilea copil este mai mare cu " << b-a << " ani";
}
return 0;
}