using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите строку: ");
string str = Console.ReadLine();// строка
Console.WriteLine("Введите подстроку: ");
string podstr = Console.ReadLine();//подстрока
var temp = str.Split().Where(i => i.Contains(podstr));
Console.WriteLine("Слова содержащие подстроку:");
foreach (var word in temp)
Console.Write(word + " ");
Console.ReadLine();
}
}
}
begin
a:=1;
for i:=1 to 10 do
begin
a:=a*2;
write(a,' ');
end;
end.
Результат:
2 4 8 16 32 64 128 256 512 1024