Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int a, b, c, d, degree;
- while(cin >> a >> b >> c >> d && (a != 0 || b != 0 || c != 0 || d != 0)) {
- degree = 1080;
- if(a <= b) {
- degree += (b - a) * 9;
- }
- else {
- degree += (40 - a) * 9;
- }
- a = b;
- if(a < c) {
- degree += (40 - a) * 9;
- }
- else {
- degree += (a - c) * 9;
- }
- a = c;
- if(a <= d) {
- degree += (d - a) * 9;
- }
- else {
- degree += (40 - a) * 9;
- }
- cout << degree << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement