Gorbachev.cs 478 B

12345678910111213141516171819
  1. class GorbachevVA
  2. {
  3. public void task1()
  4. {
  5. Console.WriteLine("Введите строку");
  6. string str = Console.ReadLine();
  7. char[] arrayChar = str.ToCharArray();
  8. for (int i = 0; i < arrayChar.Length; i++)
  9. {
  10. if ( i % 2 == 0 )
  11. {
  12. Console.Write(arrayChar[i] );
  13. }
  14. }
  15. Console.WriteLine();
  16. }
  17. }