12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Collections.Specialized;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleAppForGit
- {
- internal class Strings
- {
- public string? str = Console.ReadLine();
- void FirstTask(string str)
- {
- string strFinish = "";
- int len = str.Length;
- int i = 0;
- while (i < len)
- {
- if (i % 2 == 0)
- {
- strFinish = strFinish + str[i];
- }
- }
- Console.WriteLine(strFinish);
- }
- void NinethTask(string str)
- {
- string strFinish = "";
- string strEvenFinish = "";
- int len = str.Length;
- int i = 0;
- while (i < len)
- {
- if (i % 2 == 0)
- {
- strFinish = strFinish + str[i];
- }
- }
- while (i < len)
- {
- if (i % 2 != 0)
- {
- strEvenFinish = strEvenFinish + str[i];
- }
- }
- Console.WriteLine(strFinish);
- Console.WriteLine(strEvenFinish);
- }
- }
- }
|