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> #include <iostream> #include <fstream> using namespace std; void main(){ int testcase; cin>>testcase; for(int i=0;i<testcase;i++){ int n,p; cin>>n>>p; __int64 mult=1; for(int j=1;j<=n;j++) mult=mult*j; // printf("%I64d\n",mult); int pn=0; while(mult%10==0){ if(p==0)pn++; mult=mult/10; } while(mult>0){ __int64 ss=mult/10; __int64 tmp=mult-ss*10; if(tmp==p)pn++; mult=ss; } cout<<pn<<endl; } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator