| ||||||||||
| 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 | |||||||||
cong~In Reply To:AC 50 发帖纪念 Posted by:yao503 at 2007-10-09 10:43:50 > #include "iostream.h"
>
>
>
> int main(void)
> {
> int degree;
> int a,b,c,d,temp;
> cin>>a>>b>>c>>d;
> while(!(a==0&&b==0&&c==0&&d==0))
> {
> degree=0;
> temp=b-a;
> if (temp<=0)
> {
> temp=-temp;
> }
> else
> temp=40-temp;
> degree+=temp*9;
> temp=c-b;
> if (temp<0)
> {
> temp=40+temp;
> }
> degree+=temp*9;
> temp=d-c;
> if (temp<=0)
> {
> temp=-temp;
> }
> else
> temp=40-temp;
> degree+=temp*9;
>
>
>
>
> degree+=1080;
> cout<<degree<<endl;
>
>
> cin>>a>>b>>c>>d;
>
>
> }
> return 0;
>
>
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator