Iro4kat
01.05.2020 05:52

Dias has 500 tenge. Adilkhan has 1000 tenge. Write a program that
1. prints total amount of money
2. if they buy a bucket of ice cream which costs 1200 tenge. How much money left?
3. how many 45 tenge ice creams they can buy for left money?
Use variables! You can use their names as variables.
ВАШЕ УТОЧНЕНИЕ: :​

Нажмите на рекламу ниже и сразу увидите ответ
↓
Популярные вопросы:
Ответ:
nocitronum
30.10.2021 03:42

#include <iostream>

#include <string>

#include <algorithm>


bool P(int value)

{

   std::string left = std::to_string(value);

   std::reverse(left.begin(), left.end());

   std::string right = std::to_string(value);;

   return left == right;

}


int main()

{

   int n;

   std::cin >> n;


   int count = 0;

   for (int i = 1; i <= n; ++i)

   {

       if (P(i))

       {

           count++;

       }

   }


   std::cout << "Count palindrome: " << count << std::endl;

   return 0;

}

0,0(0 оценок)
Ответ:
пророк2345
01.01.2023 18:36
1)
var a:string;
    i, o: Integer;
    p: Real;
begin
     readln(o);
     a := inttostr(o);
     for i := 1 to length(a) do
        p := p + strtoint(a[i]);
     if (sqr(o) = p*p*p) then writeln('true')
        else writeln('false');
end.

2)
var a:string;
    i, o, p: Integer;
begin
     readln(o);
     a := inttostr(o);
     for i := 1 to length(a) do
        p := p + strtoint(a[i]);
     if (p mod 3 = 0) then writeln('true')
        else writeln('false');
end.

3)
var a, b, c: real;
begin
     readln(a, b, c);
     if ((a = b) and (b = c)) then writeln('true')
        else writeln('false');
end.

Всё проверено, удачи:)
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота