标题:[求助]遇见错误了请过来看一下啊,谢谢
取消只看楼主
nan123
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2006-8-1
 问题点数:0 回复次数:2 
[求助]遇见错误了请过来看一下啊,谢谢

一个小程序编译时遇见错误,分析不出来,谢谢您啊

#include<iostream>
using namespace std;
const float PI=3.1416;
void main()
{
int iTpye;
float radius,a,b,area;
cout<<"what is the graphic types?(one circle,two rectangle,three square):";
cin>>iType;
switch(iType)
{
case 1:
cout<<"circle radius:";
cin>>radius;
area=PI*radius*radius;
cout<<"area is:"<<area<<endl;
break;
case 2:
cout<<"rectangle long is:";
cin>>a;
cout<<"rectangle width:";
cin>>b;
area=a*b;
cout<<"the area of rectangle is:"<<area<<endl;
break;
case 3:
cout<<"square side:";
cin>>a;
area=a*a;
cout<<"the area of square is:"<<area<<endl;
break;
default:
cout<<"it is a nonlicet value!"<<endl;
}
}

--------------------Configuration: division - Win32 Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/division.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

division.exe - 2 error(s), 0 warning(s)

搜索更多相关主题的帖子: 遇见 
2007-01-04 19:37
nan123
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2006-8-1
得分:0 
谢谢soc01,yuyunliuhen两位大哥啊
我现在就修改运行看看 
2007-01-05 17:54
nan123
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2006-8-1
得分:0 
成.
iType是粗心打错了

为什么换成double就行呢
2007-01-05 18:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-114232-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.428606 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved