Problem J. Jumbled Compass---Urozero Autumn Training Camp 2016-Day 1||签到&模拟时针转动

题目描述:

Problem J. Jumbled Compass---Urozero Autumn Training Camp 2016-Day 1||签到&模拟时针转动_第1张图片

简单模拟即可

AC代码:

/*
Urozero Autumn Training Camp 2016
Day 1: NCPC-2016, Friday, November 25, 2016
Problem J. Jumbled Compass
签到题
AC 

*/ 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
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;
}


你可能感兴趣的:(WHU暑假集训,模拟,签到,钟表问题)