fork download
  1. public partial class Form1 : Form
  2. {
  3. Point startpos, endpos;
  4. public Form1()
  5. {
  6. InitializeComponent();
  7. }
  8.  
  9. private void Form1_MouseDown(object sender, MouseEventArgs e)
  10. {
  11. startpos = new Point(e.X, e.Y);
  12. }
  13.  
  14. private void Form1_MouseMove(object sender, MouseEventArgs e)
  15. {
  16. if (e.Button == MouseButtons.Left)
  17. {
  18. endpos = new Point(e.X, e.Y);
  19. Invalidate();
  20. }
  21. }
  22. private void Figure(object sender, PaintEventArgs e)
  23. {
  24. Graphics g = e.Graphics;
  25.  
  26. int width = endpos.X - startpos.X; //ここがわからないです
  27. int height = endpos.Y - startpos.Y; //
  28.  
  29. SolidBrush brush = new SolidBrush(Color.Blue);
  30. g.FillEllipse(brush, startpos.X, startpos.Y, width, height);
  31. }
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:2: error: unknown type name ‘public’
  public partial class Form1 : Form
  ^~~~~~
prog.c:1:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘class’
  public partial class Form1 : Form
                 ^~~~~
prog.c:1:17: error: unknown type name ‘class’
stdout
Standard output is empty