| ||||||||||
| 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>
using namespace std;
int main()
{int m,n,s,n1,n2,s1;
cin>>n;
for(int i=0;i<n;i++)
{ cin>>m;
cin>>s;
for(int j=1;j<m;j++)
{cin>>n2;
n1=n2;s1=s;
if(s1<n1){int temp=s1;s1=n1;n1=temp;}
while(s1%n1)
{int tem=s1;s1=n1;n1=tem%n1;}
s=s*n2/n1;
}
if(s>1e9)cout<<"More than a billion."<<endl;
else cout<<s<<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