Advertisement
Guest User

F

a guest
Dec 10th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. // 4-2
  2. /*
  3. Console.WriteLine("Type your values:");
  4. Console.Write(" x = ");
  5. uint age = uint.Parse(Console.ReadLine());
  6. string[] ages = { " лет", " год", " года" };
  7. //int[] am = { 0, 1, 2, 2, 2, 0, 0, 0, 0, 0 };
  8. uint li = age % 10;
  9. uint ld = age / 10;
  10. uint idx;
  11. if ((li == 0) || (li >= 5 && li <= 9))
  12. idx = 0;
  13. else if (li == 1)
  14. idx = 1;
  15. else
  16. idx = 2;
  17. string[] dn = { "двадцать", "тридцать", "сорок", "пятдесят", "шесдесят" };
  18. string[] nn = { "", "один", "два", "три", "четрые", "пять", "шесть", "семь", "восемь", "девять" };
  19. Console.WriteLine("Results: " + dn[ld-2] + " " + nn[li] + " " + ages[idx]);
  20. */
  21.  
  22. // 4-3
  23. /*
  24. Console.WriteLine("Type your values:");
  25. Console.Write(" (1 - R, 2 - D, 3 - L, 4 - S) e = ");
  26. uint e = uint.Parse(Console.ReadLine());
  27. Console.Write(" n = ");
  28. double n = double.Parse(Console.ReadLine());
  29. double r=0, d=0, l=0, s=0;
  30. switch (e)
  31. {
  32. case 1:
  33. r = n;
  34. d = 2 * r;
  35. l = 2 * Math.PI * r;
  36. s = Math.PI * Math.Pow(r, 2);
  37. break;
  38. case 2:
  39. d = n;
  40. r = d / 2;
  41. l = 2 * Math.PI * r;
  42. s = Math.PI * Math.Pow(r, 2);
  43. break;
  44. case 3:
  45. l = n;
  46. r = (l) / (Math.PI * 2);
  47. d = 2 * r;
  48. s = Math.PI * Math.Pow(r, 2);
  49. break;
  50. case 4:
  51. s = n;
  52. r = Math.Sqrt(s / Math.PI);
  53. d = 2 * r;
  54. s = Math.PI * Math.Pow(r, 2);
  55. break;
  56. }
  57. Console.WriteLine("Results: r = {0:0.##}, d = {1:0.##}, l = {2:0.##}, s = {3:0.##}",
  58. r, d, l, s);
  59. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement