| ||||||||||
| 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 | |||||||||
郁闷啊,我觉得没错的代码怎么wrong answer了#include<iostream>
#include<fstream>
using namespace std;
int main()
{
//ifstream cin("0000.txt");
int prime[1500];
prime[0]=2;int q=0;
int i;
for(i=3;i<10000;i++)
{
int zz=1;
for(int j=0;prime[j]*prime[j]<=i;j++)
if(i%prime[j]==0)
{zz=0;break;}
if(zz)prime[++q]=i;
}
int sum1=1;
int n;
int p[1500];
for(i=0;i<q;i++)
p[i]=0;
for(i=0;i<10;i++)
{
cin>>n;
for(int k=0;k<q&&n!=1;k++)
{
while(n%prime[k]==0)
{
p[k]++;
n/=prime[k];
}
}
}
for(i=0;i<q;i++)
if(p[i])
sum1=sum1%10*(p[i]+1)%10;
cout<<sum1%10<<endl;
//system("pause");
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator