fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. // your code goes here
  8.  
  9. int TotalScore = 0;
  10. int Status = 0;
  11.  
  12. for(int i = 0; i < 10; ++i)
  13. {
  14. TotalScore = TotalScore + Round(Status);
  15. Console.Write("这是第{0}轮,您当前的得分是{1}“,i.ToString(),TotalScore.ToString());
  16. }
  17.  
  18. if(Status > 1)
  19. {
  20. Console.WriteLine("请输入加赛得分:");
  21. int Score3 = Console.Read();
  22. TotalScore = TotalScore + RoundScore3;
  23.  
  24. Console.Write("比赛结束,您的最终得分是{0},TotalScore.ToString());
  25. }
  26. }
  27.  
  28.  
  29. //保龄球单轮得分
  30. //Status 上一轮状态,1、不全中,2、两次全中,3、单次全中
  31. public static int Round(ref int Status)
  32. {
  33. int RoundScore = 0;
  34.  
  35. Console.WriteLine("请输入第一次得分:");
  36. int Score1 = Console.Read();
  37.  
  38. if(Score1 == 10)
  39. {
  40. RoundScore = 10*(Status/2);
  41. Status = 3;
  42. return RoundScore;
  43. }
  44.  
  45. do
  46. {
  47. Console.WriteLine("请输入第二次得分:");
  48. int Score2 = Console.Read();
  49. }
  50. while(Score1 + Score2 < 11);
  51.  
  52. if(Score1 + Score2 == 10
  53. {
  54. switch(Status)
  55. {
  56. case 1:
  57. RoundScore = Score1 + Score2;
  58. break;
  59. case 2:
  60. RoundScore = 2*Score1 + Score2;
  61. break;
  62. case 3:
  63. RoundScore = 2*(Score1 + Score2);
  64. break;
  65. }
  66.  
  67. Status = 2;
  68. return RoundScore;
  69. }
  70. else
  71. {
  72. RoundScore = Score1 + Score2;
  73. Status = 2;
  74. return RoundScore;
  75. }
  76.  
  77. }
  78. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(15,74): error CS1010: Newline in constant
prog.cs(16,2): error CS1525: Unexpected symbol `}', expecting `)' or `,'
prog.cs(16,3): error CS1002: ; expected
prog.cs(24,58): error CS1010: Newline in constant
prog.cs(25,2): error CS1525: Unexpected symbol `}', expecting `)' or `,'
prog.cs(25,3): error CS1002: ; expected
prog.cs(52,28): error CS1056: Unexpected character `)'
prog.cs(53,3): error CS1525: Unexpected symbol `{'
prog.cs(56,5): error CS1525: Unexpected symbol `case'
prog.cs(56,11): error CS1525: Unexpected symbol `:'
prog.cs(59,5): error CS1525: Unexpected symbol `case'
prog.cs(59,11): error CS1525: Unexpected symbol `:'
prog.cs(62,5): error CS1525: Unexpected symbol `case'
prog.cs(62,11): error CS1525: Unexpected symbol `:'
prog.cs(70,7): error CS1519: Unexpected symbol `else' in class, struct, or interface member declaration
prog.cs(71,4): error CS9010: Primary constructor body is not allowed
prog.cs(78,0): error CS1525: Unexpected symbol `}'
Compilation failed: 17 error(s), 0 warnings
stdout
Standard output is empty