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:哪错了,各位大哥 :小妹求救!!!!!!!!!!也是九进制呀In Reply To:哪错了,各位大哥 :小妹求救!!!!!!!!!!也是九进制呀 Posted by:y05zyg at 2006-08-15 17:25:18 > # include<iostream.h> > # include<math.h> > # include<string.h> > int main () > { > char*a=new char[10]; > while(cin>>a) > { > double M=0; > if(a[0]=='0')break; > int LA=strlen(a); > int La=LA-1; > for(int i=0;i<LA;i++) > { > cout<<a[i]; > if(a[i]<'4') > { > M+=(a[i]-'0')*pow(9,La--); > } > else M+=(a[i]-'0'-1)*pow(9,La--); > } > cout<<":"<<' '<<M<<endl; > } > return 0; > } > > > Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator