Advertisement
mypal125

Yeah... I'm tricky :D

Mar 11th, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.43 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. using System.IO;
  7. using System.Threading;
  8.  
  9. namespace scred {
  10.     class Program
  11.     {
  12.         static int n;
  13.         static void Main(string[] args)
  14.         {
  15.             String nS = Console.ReadLine();
  16.             n = Convert.ToInt32(nS);
  17.             for (int ni = 1; ni <= n; ni++)
  18.             {
  19.                 String cS = Console.ReadLine();
  20.                 int c = Convert.ToInt32(cS);
  21.                 String iS = Console.ReadLine();
  22.                 int i = Convert.ToInt32(iS);
  23.                 String[] p = Console.ReadLine().Split(' ');
  24.                 for (int a = 1; a <= p.Length-2; a++)
  25.                 {
  26.                     bool done = false;
  27.                     for (int b = 1; b <= p.Length-2; a++)
  28.                     {
  29.                         if ((Convert.ToInt32(p[a]) + Convert.ToInt32(p[b])) == c)
  30.                         {
  31.                             Console.WriteLine("Case #" + ni + ": " + a + " " + b);
  32.                             Thread.Sleep(1000);
  33.                             done = true;
  34.                             break;
  35.                         }
  36.                         else
  37.                         {
  38.                             done = false;
  39.                         }
  40.                     }
  41.                     if (done) break;
  42.                 }
  43.             }
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement