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

Presentation Error错误,做过这题的兄弟帮忙看一下问题在哪

Posted by hudedi at 2005-12-26 16:39:42 on Problem 2710
/*pku 2710*/
#include<stdio.h>
int main()
{
    double n,d,b,e,n1;
    int digit10;
    int out;
    int times;
    int ii,jj,kk;
    scanf("%d",&times);
    for(ii=1;ii<=times;ii++)
    {
         scanf("%lf%lf%lf%lf",&n1,&d,&b,&e);
         n=(int)n1%(int)d;
         jj=b;
         while(jj--)
                n=7*(int)n%(int)d;
         printf("Problem set %d: %.0lf / %.0lf,base 7 digits %.0lf through %.0lf:",ii,n1,d,b,e);
         for(kk=0;kk<e+1-b;kk++)
         {

             printf("%d",out=(int)(7*((int)n%(int)d/d)));
             n=7*(int)n%(int)d;
         }
         printf("\n");

    }
    return 1;
}


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