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 |
Re:木棒程序的编程c++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; > } using namespace std; 没打 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator