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

Re:木棒程序的编程c++

Posted by HEU_xueyan at 2011-04-30 20:39:39 on Problem 1011
In Reply To:木棒程序的编程c++ Posted by:miji90000 at 2011-01-23 23:22:37
> 我是这样写的,我认为就是找最大、最小值的问题,这段代码在vc上没有问题,但是到系统来就说编译错误,新手求解。。。- =
> #include<iostream.h>
> void main()
> {
> 	int n,a[64],max,min;
> 	cin>>n;
> 	for(int i(0);i<n;i++)
> 	{cin>>a[i];}
> 	max=a[0];min=a[n-1];
> 	for(i=0;i<n;i++)
> 	{
> 		if(a[i]>max)
> 			max=a[i];
> 	}
> 	for(i=0;i<n;i++)
> 	{
> 		if(a[i]<min)
> 			min=a[i];
> 	}
> 	cout<<max+min;
> }
这代码能A么......

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