码迷,mamicode.com
首页 > 其他好文 > 详细

[ABC 099] A-ABD

时间:2018-06-11 00:44:06      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:str   sel   auth   class   ORC   IV   nbsp   ref   decide   

A - ABD


Time limit : 2sec / Memory limit : 256MB

Score : 100 points

Problem Statement

Decades have passed since the beginning of AtCoder Beginner Contest.

The contests are labeled as ABC001ABC002 from the first round, but after the 999-th round ABC999, a problem occurred: how the future rounds should be labeled?

In the end, the labels for the rounds from the 1000-th to the 1998-th are decided: ABD001ABD002ABD999.

You are given an integer N between 1 and 1998 (inclusive). Print the first three characters of the label of the N-th round of AtCoder Beginner Contest.

Constraints

  • 1≤N≤1998
  • N is an integer.

[题目解释]

  比赛从第一轮开始被标记为ABC001,ABC002,但是在第999轮ABC999之后,出现了一个问题:未来的比赛应该如何标记?最后,决定从第1000个到第1998个回合的标签:ABD001,ABD002,...,ABD999。问第n场比赛的前三个字母是什么?

[题目解析]

  这是一道简单的模拟题,由于题目问的是第n场比赛的前三个字母是什么,并且答案只有ABC和ABD两种,那么我们只需要关心第n场是在1到999之间还是1000到1998之间即可,输出对应答案;

[代码]

/*
    Name: ABD 
    Author: FZSZ-LinHua
    Date: 2018 06 10
    Exec time: 1ms
    Memory usage: 258KB
    Score: 100
    Algorithm: Brute-force 
*/
# include "iostream"
# include "cstdio"

using namespace std;

int n; 

int main(){
    scanf("%d",&n); 
    if(n<=999){
        printf("ABC"); 
    }else{
        printf("ABD"); 
    } 
    return 0; 
} 

 

[ABC 099] A-ABD

标签:str   sel   auth   class   ORC   IV   nbsp   ref   decide   

原文地址:https://www.cnblogs.com/FJ-LinHua/p/9164825.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!