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 |
木棒程序的编程c++我是这样写的,我认为就是找最大、最小值的问题,这段代码在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; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator