fork(1) download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int ile, n;
  8. int a, b, c, d, e;
  9. int tmp = 0;
  10. ile = Convert.ToInt32(Console.ReadLine());
  11. for (int i = 1; i <= ile; i++)
  12. {
  13. n = Convert.ToInt32(Console.ReadLine());
  14. string[] z = Console.ReadLine().Split(' ');
  15. if (n == 5)
  16. {
  17. tmp = 0;
  18. a = Convert.ToInt32(z[0]);
  19. b = Convert.ToInt32(z[1]);
  20. c = Convert.ToInt32(z[2]);
  21. d = Convert.ToInt32(z[3]);
  22. e = Convert.ToInt32(z[4]);
  23. }
  24. else if (n == 2)
  25. {
  26. tmp = 0;
  27. b = Convert.ToInt32(z[0]);
  28. a = Convert.ToInt32(z[1]);
  29. }
  30. for (int j = 0; j < n; j++)
  31. {
  32. tmp += Convert.ToInt32(z[j]);
  33. }
  34. Console.WriteLine(tmp);
  35. }
  36. Console.ReadKey();
  37. }
  38. }
Success #stdin #stdout 0.01s 131776KB
stdin
2
5
1 2 3 4 5
2
-100 100
stdout
15
0