用VC++编译程序的时候执行cl.exe时出错怎么办
源代码:#include<iostream.h>voidmain(){constdoublepi=3.14;doubleredius;doublearea;cout<<"...
源代码:
#include <iostream.h>
void main()
{
const double pi=3.14;
double redius;
double area;
cout<<"please input redius"<<endl;
cin>>redius;
area=pi*redius*redius;
cont<<"area of circle of redius" << redius <<" is "<<area<<"/n";
}
问题描述:
--------------------Configuration: 圆的面积 - Win32 Debug--------------------
Compiling...
圆的面积.cpp
e:\msdev98\myprojects\圆的面积\圆的面积.cpp(10) : error C2065: 'cont' : undeclared identifier
e:\msdev98\myprojects\圆的面积\圆的面积.cpp(10) : error C2297: '<<' : illegal, right operand has type 'char [25]'
执行 cl.exe 时出错.
圆的面积.exe - 1 error(s), 0 warning(s) 展开
#include <iostream.h>
void main()
{
const double pi=3.14;
double redius;
double area;
cout<<"please input redius"<<endl;
cin>>redius;
area=pi*redius*redius;
cont<<"area of circle of redius" << redius <<" is "<<area<<"/n";
}
问题描述:
--------------------Configuration: 圆的面积 - Win32 Debug--------------------
Compiling...
圆的面积.cpp
e:\msdev98\myprojects\圆的面积\圆的面积.cpp(10) : error C2065: 'cont' : undeclared identifier
e:\msdev98\myprojects\圆的面积\圆的面积.cpp(10) : error C2297: '<<' : illegal, right operand has type 'char [25]'
执行 cl.exe 时出错.
圆的面积.exe - 1 error(s), 0 warning(s) 展开
1个回答
展开全部
cout拼写错误,你给写成cont了,修改过来,另外回车可以用'\n'或者endl,但/n不是回车。
追问
修改了还是没用呢
追答
#include <iostream>
using namespace std;
int main()
{
const double pi=3.14;
double redius;
double area;
cout<<"please input redius"<<endl;
cin>>redius;
area=pi*redius*redius;
cout<<"area of circle of redius" << redius <<" is "<<area<<"\n";
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询