第一天学编程,帮我看段代码,谢谢
我今天刚学编程,超级小白,看一下我的第一个程序为啥错啊 // area.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
#define pi 3.14
#define r
#define s
#define v
float v=0;
float s=0;
float r=0;
cout<<"球半径是";
cin>>r
v=pi*r*r*4/3;
s=4*pi*r*r
cout<<"球的体积是"<<v<<endl;
cout<<"球的表面积是"<<s<<endl;
return 0;
以下是错误原因,我看不懂啊
H:\VC++6.0\MSDev98\MyProjects\helloworld\area\area.cpp(6) : error C2146: syntax error : missing ';' before identifier 'WinMain'
H:\VC++6.0\MSDev98\MyProjects\helloworld\area\area.cpp(6) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
帮我解答下吧,谢谢了