Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp1
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10.  
  11. // Console.WriteLine("dsadasd"+b+c);
  12. //int a = Convert.ToInt32(Console.ReadLine());
  13.  
  14. //УСЛОВНЫЕ ОПЕРАТОРЫ
  15. /*
  16. if (a>b) .... ;
  17. else if (b<c) .....;
  18. else if (a==b && b==c) ....;
  19. else (a!=b || b>=c)...;*/
  20. /* char c = Console.ReadKey().KeyChar;
  21. F1:
  22. switch (c)
  23. {
  24. case 'A':
  25. goto F1;
  26. break;
  27. case 'C':
  28. Console.WriteLine("2");
  29. break;
  30. case 'D':
  31. Console.WriteLine("3");
  32. break;
  33. default: Console.WriteLine("govno"); break;
  34. }*/
  35.  
  36.  
  37. //ЦИКЛЫ
  38. /*for ( int i=0;i<=10;i++)
  39. {
  40. Console.WriteLine(+i);
  41. }
  42. int a = 11;
  43. do
  44. {
  45. Console.WriteLine("govno"); !!!!!хоть 1 раз выполнится!!!!!!
  46. a++;
  47. } while (a < 10);*/
  48.  
  49.  
  50. /* float Z;
  51. Console.WriteLine("Enter b");
  52. int b = Convert.ToInt32(Console.ReadLine());
  53. Console.WriteLine("Enter c");
  54. int c = Convert.ToInt32(Console.ReadLine());
  55. Console.WriteLine("Enter d");
  56. int d = Convert.ToInt32(Console.ReadLine());
  57. Console.WriteLine("Enter a");
  58. float a = Convert.ToSingle(Console.ReadLine());
  59.  
  60. if (c >= d && a < d) Z = a + b / c;
  61. else if (c < d && a >= d) Z = a - b / c;
  62. else Z = 0;
  63. Console.WriteLine("Z=" + Z); */
  64.  
  65.  
  66. /*Console.WriteLine("Enter b");
  67. int b = Convert.ToInt32(Console.ReadLine());
  68.  
  69. Console.WriteLine("Enter a");
  70. for (int a = Convert.ToInt32(Console.ReadLine()); a <= b; a ++)
  71. {
  72. Console.WriteLine(a+1);
  73. }*/
  74.  
  75.  
  76.  
  77. ////КАЛЬКУЛЯТОРРРРРРРРРРРРРРРРР!!!!!!!!!!!!!!!!!!!!!!!!!!!
  78. /* Console.WriteLine("Enter first number");
  79. int a = Convert.ToInt32(Console.ReadLine());
  80. Console.WriteLine("chose arithmetic operation");
  81. char c = Console.ReadKey().KeyChar;
  82. Console.WriteLine(" ");
  83. Console.WriteLine("Enter second number");
  84. int b = Convert.ToInt32(Console.ReadLine());
  85. int result;
  86. switch (c)
  87. {
  88. case '+': result = a + b; Console.WriteLine("Your result is " + result); break;
  89. case '-': result = a - b; Console.WriteLine("Your result is " + result); break;
  90. case '*': result = a * b; Console.WriteLine("Your result is " + result); break;
  91. case '/': result = a / b; Console.WriteLine("Your result is " + result); break;
  92. }*/
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. Console.ReadKey();
  102. }
  103.  
  104. }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement