fork download
  1. using System;
  2. class Use_goto{
  3. public static void Main() {
  4. char choice;
  5.  
  6. for(;;){
  7. do{
  8.  
  9. Console.WriteLine("Справка по синтаксису: ");
  10. Console.WriteLine("1. Оператор if");
  11. Console.WriteLine("2. Оператор switch");
  12. Console.WriteLine("3. Цикл for");
  13. Console.WriteLine("4. Цикл while");
  14. Console.WriteLine("5. Цикл do-whiie");
  15. Console.WriteLine("6. Оператор break");
  16. Console.WriteLine("7. Оператор continue");
  17. Console.WriteLine("8. Оператор goto\n");
  18. Console.WriteLine("Введите порядковый номер оператора или цикла:");
  19. Console.WriteLine ("Для завершения работы программы " +
  20. "введите символ q.");
  21. do{
  22. choice = (char) Console.Read();
  23. } while(choice =='\n' | choice == '\r');
  24. } while( choice < '1' | choice > '8' & choice !='q');
  25. if(choice == 'q') break;
  26.  
  27. Console.WriteLine("\n");
  28.  
  29. witch (choice) {
  30. case '1':
  31. Console .WnteLine ( "Оператор i f : \ n” ) ;
  32. Console . WnteLine ("if (conaition) statemenc; ") ;
  33. Console.WriteLine("else statement;"I;
  34. break;
  35. case ' 2 ' :
  36. Console -WriteLme ("Оператор switch:\n" ) ;
  37. Console.WriteLine("switch(expression) (") ;
  38. Console.WriteLine(" case constant:");
  39. Console.Wri teLine("
  40. statement sequence”I ;
  41. Console .WriteLme ( "
  42. break;");
  43. Console.WriteLine{// ...”);
  44. Console.Wri teLine(";") ;
  45. break;
  46. case3:
  47. Console.WriteLine ("Цикл for:\n");
  48. Console.Write("for(init;condition; iteration) ") ;
  49. Console.WriteLine(" statement;”);
  50. break;
  51. case '4':
  52. Console.WriteLine(“Цикл while:\n");
  53. Console -Wri teLine("while(condition) statement;") ;
  54. break;
  55. case5:
  56. Console . WriteLme ( "Цикл do-whiic : \n" ) ;
  57. Console-WnteLine ("do {");
  58. Console.Wri teLine(“ statement;");
  59. Console . WnteLine (" > while (condition);");
  60. break;
  61. case '6’ :
  62. Console.WriteLine("Оператор break:\n");
  63. Console.WriteLine("break;");
  64. break;
  65. case '7':
  66. Console.WriteLine("Оператор continue:\n");
  67. Console.WriteLine("continue;) ;
  68. oreak;
  69. case ' 8 ' :
  70. Console.WriteLine("Оператор goto:\n");
  71. Console.WriteLine("goto laoel;");
  72. break;
  73. }
  74. Console.WriteLine();
  75. }
  76. }
  77. }
  78.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(29,15): error CS1525: Unexpected symbol `{'
prog.cs(30,0): error CS1525: Unexpected symbol `case'
prog.cs(30,7): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
prog.cs(30,8): error CS1525: Unexpected symbol `:'
prog.cs(31,37): error CS1009: Unrecognized escape sequence `\ '
prog.cs(32,0): error CS1010: Newline in constant
prog.cs(32,21): error CS1525: Unexpected symbol `if'
prog.cs(32,37): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
prog.cs(33,0): error CS1010: Newline in constant
prog.cs(33,19): error CS1525: Unexpected symbol `else'
prog.cs(33,25): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
prog.cs(34,0): error CS1010: Newline in constant
prog.cs(35,0): error CS1010: Newline in constant
prog.cs(36,0): error CS1010: Newline in constant
prog.cs(36,20): error CS1525: Unexpected symbol `Оператор'
prog.cs(36,29): error CS1525: Unexpected symbol `switch'
prog.cs(36,35): error CS1525: Unexpected symbol `:'
prog.cs(37,0): error CS1010: Newline in constant
prog.cs(37,1): error CS1525: Unexpected symbol ` ) ;
Console.WriteLine('
prog.cs(37,19): error CS1525: Unexpected symbol `switch'
prog.cs(37,38): error CS1525: Unexpected symbol `(', expecting `{'
prog.cs(38,0): error CS1010: Newline in constant
prog.cs(38,20): error CS1525: Unexpected symbol `case', expecting `{'
prog.cs(39,0): error CS1010: Newline in constant
prog.cs(40,0): error CS1525: Unexpected symbol `statement'
prog.cs(40,19): error CS1056: Unexpected character `”'
prog.cs(40,19): error CS1525: Unexpected symbol `I'
prog.cs(42,0): error CS1010: Newline in constant
prog.cs(43,17): error CS1525: Unexpected symbol `{'
prog.cs(43,19): error CS1056: Unexpected character `”'
prog.cs(44,18): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='
prog.cs(46,0): error CS1525: Unexpected symbol `case'
prog.cs(46,6): error CS1056: Unexpected character `’'
prog.cs(46,8): error CS1056: Unexpected character `’'
prog.cs(46,7): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
prog.cs(46,8): error CS1525: Unexpected symbol `:'
prog.cs(50,0): error CS1010: Newline in constant
prog.cs(51,0): error CS1010: Newline in constant
prog.cs(52,0): error CS1010: Newline in constant
prog.cs(53,13): error CS1525: Unexpected symbol `teLine'
prog.cs(55,0): error CS1525: Unexpected symbol `case'
prog.cs(55,6): error CS1056: Unexpected character `’'
prog.cs(55,8): error CS1056: Unexpected character `’'
prog.cs(55,7): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
prog.cs(55,8): error CS1525: Unexpected symbol `:'
prog.cs(57,8): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
prog.cs(58,13): error CS0128: A local variable named `teLine' is already defined in this scope
prog.cs(58,18): error CS1525: Unexpected symbol `(', expecting `,', `;', or `='
prog.cs(58,20): error CS1056: Unexpected character `“'
prog.cs(59,0): error CS1010: Newline in constant
prog.cs(59,24): error CS1525: Unexpected symbol `while'
prog.cs(60,0): error CS1010: Newline in constant
prog.cs(61,0): error CS1010: Newline in constant
prog.cs(62,0): error CS1010: Newline in constant
prog.cs(60,0): error CS1010: Newline in constant
prog.cs(61,0): error CS1010: Newline in constant
prog.cs(62,0): error CS1010: Newline in constant
prog.cs(62,19): error CS1525: Unexpected symbol `Оператор'
prog.cs(62,33): error CS1525: Unexpected symbol `:'
prog.cs(63,0): error CS1010: Newline in constant
prog.cs(63,1): error CS1525: Unexpected symbol `);
Console.WriteLine('
prog.cs(63,19): error CS1525: Unexpected symbol `break'
prog.cs(64,0): error CS1010: Newline in constant
prog.cs(65,0): error CS1010: Newline in constant
prog.cs(66,0): error CS1010: Newline in constant
prog.cs(66,19): error CS1525: Unexpected symbol `Оператор'
prog.cs(66,28): error CS1525: Unexpected symbol `continue'
prog.cs(66,36): error CS1525: Unexpected symbol `:'
prog.cs(67,0): error CS1010: Newline in constant
prog.cs(67,1): error CS1525: Unexpected symbol `);
Console.WriteLine('
prog.cs(67,19): error CS1525: Unexpected symbol `continue'
prog.cs(67,29): error CS1056: Unexpected character `”'
prog.cs(67,29): error CS1525: Unexpected symbol `)'
prog.cs(68,1): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
prog.cs(69,0): error CS1525: Unexpected symbol `case'
prog.cs(69,8): error CS1012: Too many characters in character literal
prog.cs(69,7): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement
prog.cs(69,11): error CS1525: Unexpected symbol `:'
prog.cs(78,1): error CS1525: Unexpected symbol `end-of-file'
Compilation failed: 79 error(s), 0 warnings
stdout
Standard output is empty