Advertisement
Sim0o0na

6. Special Combinations

Mar 12th, 2018
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 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 specialCombinations
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int a = int.Parse(Console.ReadLine());
  14. int b = int.Parse(Console.ReadLine());
  15. int c = int.Parse(Console.ReadLine());
  16. for (int s = 1; s <= a; s++)
  17. {
  18. for (int j = 2; j <= b; j++)
  19. {
  20. for (int i = 2; i <= c; i++)
  21. {
  22. bool isPrime = true;
  23. for (int q = 2; q <= Math.Sqrt(j); q++)
  24. {
  25. if (j%q==0)
  26. {
  27. isPrime = false;
  28. }
  29. }
  30. if (i%2==0 && s%2==0 && isPrime==true)
  31. {
  32. Console.WriteLine($"{s} {j} {i}");
  33. }
  34. }
  35. }
  36. }
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement