ответ:my_basket = {}
ware_1 = input("product name - ")
my_basket[ware_1] = int(input("value - "))
ware_2 = input("product name - ")
my_basket[ware_2] = int(input("value - "))
ware_3 = input("product name - ")
my_basket[ware_3] = int(input("value - "))
ware_4 = input("product name - ")
my_basket[ware_4] = int(input("value - "))
ware_5 = input("product name - ")
my_basket[ware_5] = int(input("value - "))
print('We bought these goods:')
print('ware -', my_basket.popitem())
print('ware -', my_basket.popitem())
print('ware -', my_basket.popitem())
print('ware -', my_basket.popitem())
print('ware -', my_basket.popitem())
print("Total cost -", total_cost)
Объяснение:
#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;
}