| ||||||||||
| 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:激动,激动,一次AC,做个无私的人,铁代码In Reply To:激动,激动,一次AC,做个无私的人,铁代码 Posted by:xiaosa001 at 2011-07-30 22:44:53 > #include <stdio.h>
> int a,b,c,d,e,f,g,h,i,j,k,l;
> int aa[10000],ab[10000],ac[10000];
> int main () {
> while(1){
> scanf("%d",&a);
> if(a==-1)break;
> for(i=0;i<a;i++){
> scanf("%d%d",&aa[i],&ab[i]);
> }
> for(i=a-1;i>0;i--){
> ab[i]=ab[i]-ab[i-1];
> }
> for(i=0;i<a;i++){
> b+=aa[i]*ab[i];
> }
> ac[c]=b;
> c++;
> b=0;
> }
> for(i=0;i<c;i++){
> printf("%d miles\n",ac[i]);
> }
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator