Advertisement
Nickzouk

protos arithmos

Nov 12th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _12._11._19trith
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string doseArithmo;
  10.  
  11. int arithmos;
  12.  
  13. int count = 0;
  14.  
  15. Console.WriteLine(" dwse arithmo ");
  16.  
  17. doseArithmo = Console.ReadLine();
  18.  
  19. arithmos = int.Parse(doseArithmo);
  20.  
  21. for (int i = 2; i < arithmos; i++)
  22. {
  23. if( arithmos % i == 0)
  24. {
  25.  
  26. count = count + 1;
  27. }
  28.  
  29.  
  30. }
  31. if ( count < 1)
  32. {
  33. Console.WriteLine(" O ARITHMOS {0} EINAI PROTOS", arithmos);
  34. }
  35. else
  36. {
  37. Console.WriteLine("O ARITHMOS EINAI {0} DEN EINAI PROTOS", arithmos );
  38. }
  39.  
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement