| ||||||||||
Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
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.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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator