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 |
麻烦看下这个为什么不对#include<stdio.h> int main() { float a,c=1.0; int b; while(scanf("%f %d",&a,&b)==2) { while(b-->0) c*=a; if(c>=1.0) { printf("%f\n",c); break; } else if(c<0.1) { int i=0; float d=c; while(d<0.1) { d*=10; i++; } while(d-(int)d>0) d*=10; printf("."); while(i--!=0) printf("0"); printf("%d\n",(int)d); } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator