Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:(G++ only) As required by the ISO C++ standard, the return type of the main function must be int, otherwise it will cause Compile Error.

Posted by MasterLuo at 2008-11-09 09:24:48
In Reply To:c++是不是包括c语言?c语言是不是c++的子集? Posted by:2571111 at 2008-11-09 09:08:05
> 1003提交时先择c语言就通过了,选择c++则编译错误。
> 代码如下:
> #include<stdio.h>
> void main()
> {
> 	int i;
> 	float x,k;
> 	scanf("%f",&k);
> 	while(k!=0.0)
> 	{
> 		x=0.0;
> 	for(i=1;x<k;i++)
> 		x=x+1.0/(i+1);
> 	printf("%d card(s)\n",i-1);
> 	scanf("%f",&k);
> 	}
> }

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator