fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.IO;
  13.  
  14. namespace LTHDT
  15. {
  16.  
  17. class HOCSINH
  18. {
  19. private string HoTen;
  20. private string MaHS;
  21. private string DiaChi;
  22. private int DiemToan;
  23. private int DiemVan;
  24. private double DiemTb;
  25. public void Nhap(string ghichu)
  26. {
  27. Console.WriteLine(ghichu);
  28. Console.WriteLine("Nhap vao ma HS :");
  29. this.MaHS = Console.ReadLine();
  30. Console.WriteLine("Nhap vao Ho va ten HS :");
  31. this.HoTen = Console.ReadLine();
  32. Console.WriteLine("Nhap vao dia chi :");
  33. this.DiaChi = Console.ReadLine();
  34. Console.WriteLine(ghichu);
  35. Console.WriteLine("Nhap vao Diem Toan :");
  36. this.DiemToan = int.Parse(Console.ReadLine());
  37. Console.WriteLine("Nhap vao Diem Van :");
  38. this.DiemVan = int.Parse(Console.ReadLine());
  39.  
  40. }
  41. public void KhoiTaoHS(string s)
  42. {
  43. string[] M = s.Split(',');
  44.  
  45. this.MaHS = M[0];
  46. this.HoTen = M[1];
  47. this.DiaChi = M[2];
  48. this.DiemToan = int.Parse(M[3]);
  49. this.DiemVan = int.Parse(M[4]);
  50.  
  51.  
  52. }
  53. public double TinhDiemTB()
  54. {
  55.  
  56. this.DiemTb = (this.DiemToan * 2 + this.DiemVan) / 3.0;
  57. return this.DiemTb;
  58. }
  59. public void XuatHS(string ghichu)
  60. {
  61. string s = $"{this.MaHS},t{this.HoTen},t{this.DiaChi},t{this.DiemToan},t{this.DiemVan}";
  62. Console.WriteLine(s);
  63. }
  64. public void Luu(string filepath)
  65. {
  66.  
  67. StreamWriter writer = new StreamWriter(filepath);
  68. string s = $"{this.MaHS},t{this.HoTen},t{this.DiaChi},t{this.DiemToan},t{this.DiemVan}";
  69. writer.WriteLine(s);
  70. writer.Close();
  71. }
  72. }
  73. }
  74. }
  75. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(7,7): error CS1525: Unexpected symbol `System', expecting `('
prog.cs(8,6): error CS1525: Unexpected symbol `System', expecting `('
prog.cs(9,6): error CS1525: Unexpected symbol `System', expecting `('
prog.cs(10,6): error CS1525: Unexpected symbol `System', expecting `('
prog.cs(11,6): error CS1525: Unexpected symbol `System', expecting `('
prog.cs(12,6): error CS1525: Unexpected symbol `System', expecting `('
prog.cs(14,0): error CS1525: Unexpected symbol `namespace'
prog.cs(15,0): error CS1525: Unexpected symbol `{'
prog.cs(17,4): error CS1525: Unexpected symbol `class'
prog.cs(18,4): error CS1525: Unexpected symbol `{'
prog.cs(19,8): error CS1525: Unexpected symbol `private'
prog.cs(20,8): error CS1525: Unexpected symbol `private'
prog.cs(21,8): error CS1525: Unexpected symbol `private'
prog.cs(22,8): error CS1525: Unexpected symbol `private'
prog.cs(23,8): error CS1525: Unexpected symbol `private'
prog.cs(24,8): error CS1525: Unexpected symbol `private'
prog.cs(25,11): error CS1525: Unexpected symbol `public'
prog.cs(25,19): error CS1547: Keyword `void' cannot be used in this context
prog.cs(25,27): error CS1525: Unexpected symbol `('
prog.cs(41,8): error CS1525: Unexpected symbol `public'
prog.cs(41,16): error CS1547: Keyword `void' cannot be used in this context
prog.cs(41,29): error CS1525: Unexpected symbol `('
prog.cs(53,8): error CS1525: Unexpected symbol `public'
prog.cs(53,32): error CS1525: Unexpected symbol `('
prog.cs(73,0): error CS1525: Unexpected symbol `}'
Compilation failed: 25 error(s), 0 warnings
stdout
Standard output is empty