Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace aaa
- {
- class Program
- {
- static void Main(string[] args)
- {
- int N1 = int.Parse(Console.ReadLine());
- int N2 = int.Parse(Console.ReadLine());
- if (N1 == N2)
- {
- Console.WriteLine(N2);
- Environment.Exit(0);
- }
- for (int i = N2; i >= 0; )
- {
- N2 = i;
- i = N1 % N2;
- N1 = N2;
- if(N1 % i == 0 && N2 % i == 0)
- {
- Console.WriteLine(i);
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement