zh_stoqnov

Tic_Tac_Toe_Power

Nov 4th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 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.Numerics;
  7.  
  8. namespace Tic_Tac_Toe_Power
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. int y = int.Parse(Console.ReadLine());
  15. int x = int.Parse(Console.ReadLine());
  16. int v = int.Parse(Console.ReadLine());
  17.  
  18. int one = 1;
  19. int[] ticTacToe = new int[9];
  20. double x1 = 0;
  21. double x2 = 0;
  22. for (int a = 0; a < 3; a++)
  23. {
  24. for (int b = 0; b < 3; b++)
  25. {
  26. ticTacToe[a] = one;
  27. one++;
  28. int multi = ticTacToe[a];
  29. if(x == a && y == b)
  30. {
  31. x2 = multi;
  32. }
  33. }
  34. }
  35. for (int a = 0; a < 3; a++)
  36. {
  37. for (int b = 0; b < 3; b++)
  38. {
  39. ticTacToe[a] = v;
  40. v++;
  41. int num = ticTacToe[a];
  42. if (x == a && y == b)
  43. {
  44. x1 = num;
  45.  
  46. }
  47. }
  48. }
  49. BigInteger z = 1;
  50. for(int i = 0; i < x2; i++)
  51. {
  52. z *= (BigInteger)x1;
  53. }
  54. Console.WriteLine(z);
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment