Сначала сделал с рекурсивной функции, но затруднение было только с суммой элементов, по этому написал через цикл как впрочем и должно быть.
Console.WriteLine("Введите число");
int x = Convert.ToInt32(Console.ReadLine());
int y = x;
int sum = 0;
for (int i = 0; i < 4; i++)
{
y = x % 10;
x = x / 10;
Console.Write(y);
sum = sum + y;
}
Console.Write(" = " + sum);
Console.ReadLine();
#incude <iostream>
#include <conio.h>
using namespace std;
int main()
{
int a,b,c;
cin >> a;
cin >> b;
cin >> c;
if (a < b || a <c)
cout << a << endl;
if (b < a|| b < c)
cout << c << endl;
if (c < b || c < a)
cout << c << endl;
return = 0;
}