Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

麻烦看下这个为什么不对

Posted by DavidCameron at 2017-02-11 10:36:14 on Problem 1001
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator