#include <iostream> using namespace std; int add(int x, int y) { int result; result = x+y; return result; } double add(double x, double y) { double result; result = x+y; return result; } int sub(int x, int y) { int result; result = x-y; return result; } double sub(double x, double y) { double result; result = x-y; return result; } int mul(int x, int y) { int result; result = x*y; return result; } double mul(double x, double y) { double result; result = x*y; return result; } int divi(int x, int y) { int result; result = x/y; return result; } double divi(double x, double y) { double result; result = x/y; return result; } int main() { double a; double b; int m,n; cin>>a>>b; cout<<add(a,b)<<endl; cout<<sub(a,b)<<endl; cout<<mul(a,b)<<endl; cout<<divi(a,b)<<endl; cin>>m>>n; cout<<add(m,n)<<endl; cout<<sub(m,n)<<endl; cout<<mul(m,n)<<endl; cout<<divi(m,n)<<endl; system("pause"); return 0; }
0 comments:
Post a Comment