fork download
  1.  
  2.  
  3. var a,b : longint;
  4. begin
  5. readln(a,b);
  6. writeln(a,b);
  7. end.
  8.  
  9. // ---------------------------------------------------------------------
  10.  
  11. problem: a + b, with number of testcase given --> use for
  12. sample input
  13. 3 // --> testcase / number of question below
  14. 1 2 // --> first testcase
  15. 9 2 / /--> second testcase
  16. 19 6 // --> third testcase
  17. sample output
  18. 3
  19. 11
  20. 25
  21.  
  22. var a,b : longint;
  23. i,tc : longint;
  24. begin
  25. readln(tc);
  26. for i := 1 to tc do begin
  27. readln(a,b);
  28. writeln(a,b);
  29. end;
  30. end.
  31.  
  32. // ---------------------------------------------------------------------
  33.  
  34. problem: a + b, with multiple testcase --> use while not eof
  35. sample input
  36. 3 2
  37. 1 2
  38. 10 5
  39. 18 9
  40. sample output
  41. 5
  42. 3
  43. 15
  44. 27
  45.  
  46. var a,b : longint;
  47. begin
  48. while not eof(input) do begin
  49. readln(a, b);
  50. writeln(a, b);
  51. end;
  52. end.
  53.  
  54. // while using "while not eof(input)", use ctrl+C to terminate the program.
  55.  
  56. // ---------------------------------------------------------------------
  57.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
00