Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main()
- {
- Console.WriteLine("Please, enter the a = ");
- int a = int.Parse(Console.ReadLine());
- Console.WriteLine("Please, enter the b = ");
- int b = int.Parse(Console.ReadLine());
- while (a < b)
- {
- int c = 2*a + 1;
- int k = c;
- for (int i = a + 1; i > 1; i--)
- {
- if (c % i == 0)
- {
- c = c / i; break;
- }
- }
- if (c != k)
- {
- Console.WriteLine("{0},{1};", a, (a + 1));
- }
- a++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement