Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Exe
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             long a, b, c;
  14.             Console.WriteLine("Введите коефицент при X");
  15.             while (!long.TryParse(Console.ReadLine(), out a)) ;
  16.             Console.WriteLine("Введите свободный коефицент");
  17.             while (!long.TryParse(Console.ReadLine(), out b)) ;
  18.             Console.WriteLine("Введите основание(число у Z)");
  19.             while (!long.TryParse(Console.ReadLine(), out c)) ;
  20.             long x = 0;
  21.             while ((a * x + b) % c != 0)
  22.                 x++;
  23.             Console.WriteLine(x);
  24.             Console.Read();
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement