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 zjulonely at 2009-03-16 13:17:23 on Problem 3720
#include<iostream>
> #include<vector>
> using namespace std;
> int main(){
>   int n,k;
>   int num[10];
>   int temp[10];
>   for(int i=0;i<10;i++){num[i]=0;temp[i]=0;}
>   cin>>n>>k;
>   for(int i=2;i<=n;i++)
>    {int remain=1;
>     while(remain!=0)
>        {if(++temp[remain*10/i]>1)break;
>         ++num[remain*10/i];
>         remain=(remain*10)%i;}
>   for(int j=0;j<10;j++)temp[j]=0;}
>   cout<<num[k]<<endl;
>   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