- 1,题目描述:
文具店的水笔的单价是一个整数,小明从文具店买了x支水笔花了y元?请问如果你要从该文具店购买5支水笔需要付多少钱?
- 2,总代码
#include<iostream>
using namespace std;
int main() {
int x,y;
cin>>x>>y;
cout<<y/x*5;
return 0;
}
文具店的水笔的单价是一个整数,小明从文具店买了x支水笔花了y元?请问如果你要从该文具店购买5支水笔需要付多少钱?
#include<iostream>
using namespace std;
int main() {
int x,y;
cin>>x>>y;
cout<<y/x*5;
return 0;
}