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?给的数据都测过了#include<iostream> #include<cmath> using namespace std; int main() { char a; double sum; int i,j,s=1,num[50]; while(s>0) { s=0; for(i=0;;i++) { a=cin.get(); if(a=='\n') break; else { num[i]=a-48; s+=num[i]; } } if(s==0) break; sum=0; for(j=0;j<i;j++) sum+=num[j]*(pow((float)2,i-j)-1); cout << sum << endl; }; system("pause"); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator