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:呵呵,改了你的代码In Reply To:Re:呵呵,改了你的代码 Posted by:kric at 2007-03-16 21:09:42 #include<iostream> using namespace std; int main() { char p[9][8]; int n,i,a,b,c,min,max,*q; while(1) { cin>>n; if(n==-1) return 1; q=new int [n]; for(i=0;i<n;i++) { cin>>a>>b>>c>>p[i]; q[i]=a*b*c; } max=min=0; for(i=1;i<n;i++) { if(q[i]>q[max]) max=i; if(q[i]<q[min]) min=i; } cout<<p[max]<<" took clay from "<<p[min]<<"."<<endl; } return 1; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator