Викторина: покупка зелий
#include <iostream>
#include <string>
int main() {
std::string command = "buy 4";
int price = 30;
int space = command.find(' ');
int amount = std::stoi(command.substr(0, space));
std::cout << "Вы платите " << amount * price << " золота" << std::endl;
return 0;
}