VC++程序修改

来源:百度知道 编辑:UC知道 时间:2024/05/29 03:45:08
帮忙看看这个那里错了..各位大侠!
#include "stdafx.h"
#include "iostream.h"
int main()
{
const float PI=3.14
float r,s,l
cout<<"请输入半径:";
cin>>r;
l=r*2*PI;
s=r*r*PI;
cout<<"周长为:"<<l<<endl;
cout<<"面积为:"<<s<<endl;
return 0;
}

从程序上来看,语法上没有出错

main的头两行没有分号结尾。。。
如果用VC7的话,是没有iostream.h这个头文件的
应该
#include <iostream>

using namespace std;