Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace methods_exerci
- {
- class Program
- {
- static void Main(string[] args)
- {
- PrintResult(Console.ReadLine());
- }
- static void PrintResult(string text)
- {
- if (text.Length % 2 == 0)
- {
- for (int i = (text.Length/2 - 1); i <= text.Length/2; i++)
- {
- Console.Write(text[i]);
- }
- }
- else
- {
- for (int i = (text.Length / 2); i < (text.Length / 2 + 1); i++)
- {
- Console.Write(text[i]);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement