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 ConsoleApp2
- {
- class Program
- {
- static long T = 3;
- static long P = 5;
- static long H = 6;
- static long Tn = 3;
- static long Pn = 7;
- static long Hn = 9;
- static void Main(string[] args)
- {
- int nums = 0;
- while (nums <= 1)
- {
- if (T <= P && T <= H)
- {
- T += Tn;
- Tn += 1;
- }
- else if (P <= T && P <= H)
- {
- P += Pn;
- Pn += 3;
- }
- else if (H <= T && H <= P)
- {
- H += Hn;
- Hn += 4;
- }
- if ((T == P) && (T == H))
- nums++;
- }
- Console.WriteLine(T);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement