Description |
第一行有两个数,第二行有三个数,分别计算它们的乘积并输出。 |
Input |
a b a b c |
Output |
a和b的乘积 a、b和c的乘积 |
Sample Input |
3 5 2 3 4 |
Sample Output |
15 24 |
Hint |
int main(){ int a,b,c; cin>>a>>b; cout<<mul(a,b)<<endl; cin>>a>>b>>c; cout<<mul(a,b,c)<<endl; } |
#include<bits/stdc++.h>
using namespace std;
int mul(int a, int b) {
return a * b;
}
int mul(int a, int b, int c) {
return a * b * c;
}
int main() {
int a, b, c;
cin >> a >> b;
cout << mul(a, b) << endl;
cin >> a >> b >> c;
cout << mul(a, b, c) << endl;
}