#17519: 給延平的同仁 c++ AC


089487 (089487)

學校 : 國立臺灣師範大學附屬高級中學
編號 : 82069
來源 : [220.130.10.185]
最後登入時間 :
2024-04-01 11:16:18
c006. 10550 - Combination Lock -- UVa10550 | From: [42.72.109.51] | 發表日期 : 2019-04-17 13:39

#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d;
int degree;
while(cin>>a>>b>>c>>d)
{
if(a==0&&b==0&&c==0&&d==0) break;
//if(a<b) degree+=40;
//if(b>c) degree+=40;
//if(d>c) degree+=40;
cout<<((a-b)+(c-b)+(c-d)+(a<b)*40+(b>c)*40+(d>c)*40)*9+720+360<<endl;
}
}

 
#17523: Re:給延平的同仁 c++ AC


ufve0704 (爬 我爬 我爬爬爬 有排行榜這種東西就是要爬 爬過我上面的那...)

學校 : 臺北市私立延平高級中學
編號 : 83268
來源 : [203.72.178.1]
最後登入時間 :
2023-10-30 13:02:50
c006. 10550 - Combination Lock -- UVa10550 | From: [114.42.219.181] | 發表日期 : 2019-04-17 18:50

#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,d;
int degree;
while(cin>>a>>b>>c>>d)
{
if(a==0&&b==0&&c==0&&d==0) break;
//if(a<b) degree+=40;
//if(b>c) degree+=40;
//if(d>c) degree+=40;
cout<<((a-b)+(c-b)+(c-d)+(a<b)*40+(b>c)*40+(d>c)*40)*9+720+360<<endl;
}
}

這樣:

#include<bits/stdc++.h>

using namespace std;

int main(){

int a,b,c,d;

while(cin>>a>>b>>c>>d&&(a+b+c+d))

cout<<((a-b)+(c-b)+(c-d)+(a<b)*40+(b>c)*40+(d>c)*40)*9+720+360<<endl;

}

 
ZeroJudge Forum