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

HUST 1602 Substring

时间:2016-03-07 08:57:26      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:

水题。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;

long long L, R;
string Q = "XHUSTACM";

int main()
{
    while (~scanf("%lld%lld", &L, &R))
    {
        long long tot = R - L + 1;
        long long st = L % 8;
        if (st == 0) st = 8;

        long long now = 0;
        while (1)
        {
            printf("%c", Q[st-1]);
            now++;
            if (now == tot) break;
            st++;
            if (st == 9) st = 1;
        }
        printf("\n");

    }
    return 0;
}

 

HUST 1602 Substring

标签:

原文地址:http://www.cnblogs.com/zufezzt/p/5249335.html

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