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 |
好奇怪为什么把语言选择为C不可以编译,选择C++就可以通过呢?#include<stdio.h> #include<math.h> void main() { double num = 0; int sum=0; int i; int n; while(scanf("%d",&n)) { sum = 0; if(n==0) break; for( i=1; i<=n;i++) { num = (sqrt(1+8*i)-1)/2.0; if((num-int(num))!=0) num = num +1; sum += int(num); } printf("%d %d\n",n,sum); } } 代码如上,明明是用c语言写的,把语言选择为C却显示 C E,而选择C++却可以Accepted? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator