using System;
namespace restless
{
class Program
{
static void Main(string[] args)
{
int N;
bool _isBin = true;
N = Convert.ToInt32(Console.ReadLine());
N = Math.Abs(N);
while (N > 0)
{
if (N % 10 != 0 && N % 10 != 1)
{
_isBin = false;
break;
}
N /= 10;
}
Console.WriteLine(_isBin);
}
}
}
var
money , cost , i:integer;
begin
read(money); // Стартовые деньги
for i := 1 to 5 do begin
read(cost); //Ввод цены предмета
money := money - cost;
end;
if(money < 0) then
write('No')
else
write('Yes');
end.
Объяснение: