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<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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator