Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SzTFLabor04
- {
- class Program
- {
- static bool OsztoiE(int a, int b)
- {
- if (a % b == 0)
- {
- return true;
- }
- if (b % a == 0)
- {
- return true;
- }
- return false;
- }
- static void Main(string[] args)
- {
- Console.ForegroundColor = ConsoleColor.Black;
- Console.BackgroundColor = ConsoleColor.White;
- Console.Title = "SzTFLabor";
- Console.Clear();
- Console.Write("A=? ");
- int a = int.Parse(Console.ReadLine());
- Console.Write("B=? ");
- int b = int.Parse(Console.ReadLine());
- if (OsztoiE(a, b))
- {
- Console.WriteLine("A két szám egymás osztói!");
- }
- else
- {
- Console.WriteLine("A két szám nem egymás osztói!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment