当前位置:编程学习 > VC++ >>

在vc++6.0中编写下面的程序,编译没有错误,但是执行的时候有一个错误,但是苦思没找出错误,请大侠指教。

#include<stdio.h> #include<math.h> void main() { int s; float n,pi,t; t=1;pi=0;n=1.0;s=1; while(fabs(t)>1e-6) { pi=pi+t; n=n+2; s=-s; t=s/n; } pi=pi*4; printf("pi=%10.6f\n",pi); }
补充:错误提示是“ _main already defined in 输入m.obj
Debug/输入m.exe : fatal error LNK1169: one or more multiply defined symbols found
执行 link.exe 时出错.”
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,