Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:激动,激动,一次AC,做个无私的人,铁代码

Posted by sxn at 2014-08-07 09:33:40 on Problem 2017
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator