Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void readable_nums(ref string k)
- {
- int i = 3;
- int m = k.Length;
- while (i <m)
- {
- k = k.Insert(m - i, ".");
- i += 3;
- }
- }
- static void no_subs(ref string s, string subs)
- {
- while(s.Contains(subs))
- s = s.Replace(subs, "");
- }
- static void middle_symbol_replacement(ref string s)
- {
- //Console.WriteLine(s.Length % 2);
- //Console.WriteLine(s.Length / 2);
- s =s.Remove(s.Length / 2, 2-(s.Length % 2));
- }
- static void Main(string[] args)
- {
- Console.Write("Введите s:");
- string s = Console.ReadLine();
- Console.Write("Введите subs:");
- string subs = Console.ReadLine();
- string dots = s;
- string k = s;
- string m = s;
- string f = s;
- readable_nums(ref k);
- no_subs(ref m, subs);
- middle_symbol_replacement(ref f);
- Console.WriteLine("Результат первой задачи:"+k);
- Console.WriteLine("Результат второй задачи:" + m);
- Console.WriteLine("Результат третьей задачи:" + f);
- //Console.WriteLine("Результат исполнения второй задачи:"+s.Replace())
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement