Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- while (true)
- {
- Console.WriteLine("Введите первое число");
- int N = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Введите второе число");
- int N2 = Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("Результат "+ maxNumbersInTwo(N,N2));
- }
- }
- static int maxNumbersInTwo(int a,int b)
- {
- int reservA = a;
- int reservB = b;
- int count = 0;
- int count2 = 0;
- while(a > 0)
- {
- count++;
- a /= 10;
- }
- while (b > 0)
- {
- count2++;
- b /= 10;
- }
- if(count > count2)
- {
- return reservA;
- }
- else
- {
- return reservB;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement