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 |
大家帮我看看为什么不对#include<iostream> using namespace std; int main() { int i,n,t,s,*p; cin>>n; p=new int[n]; for(i=0;i<n;i++) cin>>p[i]; t=p[0]; for(i=1;i<n;i++) if(p[i]<t) t=p[i]; s=0; for(i=0;i<n;i++) s+=p[i]; s+=t*(n-3); if(n>1) cout<<s<<endl; else cout<<p[0]<<endl; delete[]p; return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator