fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. int numberOfTests;
  8. int[] arrayOfNumbers = new int[100];
  9. string[] splittedData;
  10. int firstNumber, secondNumber;
  11. double wynik;
  12.  
  13. // Step 1. Read and upload numbers of repetitions
  14. numberOfTests = TakeNumberOfTests();
  15. // Step 2. Calculations
  16. for (uint i = 0; i < numberOfTests; i++)
  17. {
  18. splittedData = PodzielBufor(PobierzBufor(),' ');
  19. firstNumber = TakeNumber(splittedData,1);
  20. secondNumber = TakeNumber(splittedData,2);
  21. wynik = NWW(firstNumber,secondNumber);
  22. Console.WriteLine("{0}",wynik);
  23. }
  24.  
  25.  
  26. // All functions
  27. int TakeNumberOfTests()
  28. {
  29. int ans = Int.Parse(Console.ReadLine());
  30. return ans;
  31. }
  32.  
  33. int NWD(int a, int b)
  34. {
  35. int zmiennaPomocnicza;
  36. while(b!=0)
  37. {
  38. zmiennaPomocnicza = b;
  39. b = a%b;
  40. a = zmiennaPomocnicza;
  41. }
  42. return a;
  43. }
  44.  
  45. double NWW(int a, int b)
  46. {
  47. double result;
  48. result = (a*b)/NWD(a,b);
  49. return result;
  50. }
  51. string PobierzBufor()
  52. {
  53. return Console.ReadLine(); //odczyt danych ze strumienia
  54. }
  55. string[] PodzielBufor(string inputData, char character)
  56. {
  57. string[] splittedData;
  58. splittedData = inputData.Split(character);
  59. return splittedData;
  60. }
  61. int TakeNumber(string[] dataArray,int number)
  62. {
  63. return Int32.Parse(dataArray[number-1]);
  64. }
  65. }
  66. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2
11 22
12 15
compilation info
prog.cs(27,33): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='
prog.cs(66,0): error CS1525: Unexpected symbol `}'
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty