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 wangwenguang at 2007-11-11 11:17:47 on Problem 3002
#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:
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