首页 > 其他 > 详细

HUST 1602 Substring

时间:2016-03-07 08:56:11      阅读:270      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!