题目描述:
简单模拟即可
AC代码:
/*
Urozero Autumn Training Camp 2016
Day 1: NCPC-2016, Friday, November 25, 2016
Problem J. Jumbled Compass
签到题
AC
*/
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <stack>
#include <vector>
#include <queue>
using namespace std;
int main(){
int a,b;
scanf("%d%d",&a,&b);
int tmp=a-b;
if(abs(tmp)==180) printf("180\n");
else if(abs(tmp)<180){
printf("%d\n",0-tmp);
}else{
if(tmp>180){
printf("%d\n",360-tmp);
}else{
printf("-%d\n",(tmp+360)%360);
}
}
return 0;
}