|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
我自己做的answer,请大家看看哪里有问题:
#include<iostream>
using namespace std;
long cal ( int x );
long cal ( int x, int y );
long cal ( int x, int y ,int z );
int main()
{
int i,j,k;
cout << "Please enter 1 number: " ;
cin >> i;
cout << cal( i );
cout << "\n";
cout << "please enter 2 numbers: ";
cin >> i >> j;
cout << cal ( i, j);
cout << "\n";
cout << "please enter 3 numbers:";
cin >> i >> j >> k;
cout << cal(i,j,k);
cout << "\n";
return 0;
}
long cal ( int x )
{
return (x * x );
}
long cal ( int x, int y )
{
return (x * y );
}
long cal ( int x, int y ,int z )
{
return (x + y + z );
}
|
|