简单c++中的函数,求解
//运行错误??#include "stdafx.h"
#include "iostream"
using namespace std;
double perimeter(double wid, double hei)
{
return (wid+hei)*2;
};//周长函数
double area(double wid, double hei)
{
return wid*hei;
};//面积函数
int _tmain(int argc, _TCHAR* argv[])
{
double width,height;//定义变量参数
cout<<"enter width and height:"<<endl;
cin>>width>>height;//输入宽与高
cout<<"perimeter="<<perimeter(width ,height)<<endl;
cout<<"area="<<area(width ,height)<<endl;
system("pause");
return 0;
};