//Author:xtyang
//记得大一学C说话,永远都不熟悉打听如何调用一个函数,真是好可爱呀。
#include<iostream>
using namespace std;
//定义函数原型
int add(int m,int n);
int minus(int m,int n);
//Main,法度进口
int main()
{
int r,p,res,opt;
cout<<Please input the opt to run responding command.\n
<<1.Add Function.\n
<<2.Minus Function
<<endl;
cin>>opt;
cout<<Please input the two num to be calc.<<endl;
cin>>r>>p;
switch(opt)
{
case 1:
res = add(r,p);
break;
case 2:
res = minus(r,p);
break;
default:
res = 0;
break;
}
cout<<The result is:<<res<<endl;
}
int add(int m,int n)
{
int res = m+n;
return (res);
}
int minus(int m,int n)
{
return (m-n);
}