MuffinMonster

Class Task 36#

Dec 10th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static bool mehalkim(int num1, int num2)
  11.         {
  12.             bool good = false;
  13.             for (int i = 1; i <= num1 || i <= num2; i++)
  14.             {
  15.                 if ((num1 % i ==0) && (num2 % i == 0))
  16.                 good = true;
  17.             }
  18.             return good;
  19.         }
  20.         static void Main(string[] args)
  21.         {
  22.             int num1, num2, total;
  23.             bool hiluk;
  24.             for (int i = 1; i <= 20; i++)
  25.             {
  26.             num1 = int.parse(Console.Readline());
  27.             num2 = int.parse(Console.Readline());
  28.             hiluk = mehalkim(num1, num2);
  29.             if (hiluk == false)
  30.                 total++;
  31.             }
  32.             Console.Writeline(total);
  33.         }
  34.     }
  35. }
Add Comment
Please, Sign In to add comment