Advertisement
Leitenantochko

Untitled

Feb 26th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Globalization;
  7. using System.Threading;
  8.  
  9. namespace project3
  10. {
  11. class Program
  12. {
  13. static void Main(string[] args)
  14. {
  15. //Выполнение 2 пункта
  16.  
  17. Console.Write("Введите строку :");
  18. string f = Console.ReadLine();
  19. string[] slova = f.Split(' ',',','.','!');//разбиваем строку на слова
  20. for (int i = slova.Length - 1; i >= 0; i--)//у каждого массива в c# есть метод .Length(этот метод возвращает кол-во элементов с отсчетом от 1,здесь же нужно от 0,т.к массив)
  21. {
  22. Console.Write("{0} ",slova[i]);
  23. }
  24. Console.Write("\n");
  25.  
  26.  
  27. //Выполнение 7 пункта
  28.  
  29. Console.Write("Введите строку :");
  30. string str = Console.ReadLine();
  31. int a = str.Length;
  32. for(int i=1;i<=a;i++)
  33. {
  34. Console.Write("{0:X4} ",i);
  35. }
  36. Console.WriteLine("\n");
  37.  
  38. //Выполнение 8 пункта
  39.  
  40. Console.WriteLine("Введите язык в формате: es-английский,fr-французский,ru-русский,ch-китайский,jp-японский и т.д.");
  41. string languange = Console.ReadLine();
  42. Thread.CurrentThread.CurrentCulture = new CultureInfo(languange);
  43. DateTime now = new DateTime(2020,1,1);
  44.  
  45. for(int i=1;i<=12;i++)
  46. {
  47. Console.WriteLine(now.ToString("MMMM"));
  48. now = now.AddMonths(1);
  49. }
  50.  
  51.  
  52. Console.ReadKey();
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement