c++代码说明文具店的水笔的单价是一个整数小明从文具店买了x支水笔花了y元?请问如果你要从该文具店购买5支水笔需要付多少钱?输入格式两个整数x和y用空格隔开分别代表小明买的水笔的支数和他付给老板的金额输出格式一个整数代表如果你买5支水笔应该付给老板的金额
#include
int main() { int x, y; cin >> x >> y; int price = y / x; int total = price * 5; cout << total << endl; return 0; }
原文地址: https://www.cveoy.top/t/topic/h2jg 著作权归作者所有。请勿转载和采集!