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

memory.h

Posted by TN at 2005-04-29 17:50:24 on Problem 1014
In Reply To:帮忙看看哪里错了,为什莫Cannot open include file: 'mem.h': Posted by:lian at 2005-04-29 17:48:43
> #include<iostream.h>
> //#include<mem.h>
> 
> int main(){
> 	long int a[7]={0,0,0,0,0,0,0}, m[7]={0,0,0,0,0,0,0}, b[7]={0,0,0,0,0,0,0},sum=0, Msum=0,time=1;
> 
> 	for(int i=1; i<7; i++){
> 		cin>>a[i];
> 		sum+=a[i]*i;;
> 	}
> 	while(sum!=0){
> 		cout<<"Collection #"<<time<<':'<<endl;
> 		for(int i=1; i<7; i++){
> 			if(a[i]%2==0)
> 				m[i]=a[i]/2;
> 			else
> 				m[i]=(a[i]+1)/2;
> 		}
> 		for(i=1; i<7; i++)
> 			Msum+=m[i]*i;
> 		
> 		if(sum%2==1)
> 			cout<<"Can't be divided.\n"<<endl;
> 		else{
> 			if((Msum-sum/2)%2!=0)
> 				cout<<"Can't be divided.\n"<<endl;
> 			else{
> 				int p=Msum-sum/2;
>                 for(int i=6; i>0; i--){
> 					int n=p/i;
> 				    n=(n<=m[i]? n:a[i]);
> 				    p=p-n*i;
> 				} 
> 		    	if(p==0)
> 			    	cout<<"Can be divided.\n"<<endl;
> 	    		else 
> 		    		cout<<"Can't be divided.\n"<<endl;
> 			}
> 		}
> 		Msum=0;
>         sum=0;
> 		for(i=1; i<7; i++){
> 			a[i]=0;
> 			b[i]=0;
> 			m[i]=0;
> 		}
> 		for(i=1; i<7; i++){
> 			cin>>a[i];
> 		    sum+=a[i]*i;
> 		}
>         time++;
> 	}
> 	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