fork download
  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.  
  8. class Punkt
  9. {
  10. public int x, y;
  11. public Punkt(int xx, int yy) { x = xx; y = yy; }
  12.  
  13. }
  14. class Linia
  15. {
  16. private Punkt p1, p2;
  17.  
  18. public Linia(Punkt a, Punkt b)
  19. {
  20. p1 = a;
  21. p2 = b;
  22. }
  23. public void przesun(int dx, int dy)
  24. {
  25. p1.x += dx; p1.y += dy; p2.x += dx; p2.y += dy;
  26. }
  27. public String toString()
  28. {
  29. return "(" + p1.x + "," + p1.y + ")->(" + p2.x + "," + p2.y + ")";
  30. }
  31. }
  32.  
  33. namespace po2
  34. {
  35. class Program
  36. {
  37. static void Main(string[] args)
  38. {
  39. Punkt pierwszy = new Punkt(0, 0);
  40. Punkt drugi = new Punkt(1, 1);
  41. Linia l1 = new Linia(pierwszy, drugi);
  42. Linia l2 = new Linia(pierwszy, drugi);
  43. System.out.print(l2.toString());
  44.  
  45. }
  46. }
  47. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(43,19): error CS1041: Identifier expected, `out' is a keyword
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty