HUST 1602 Substring
水题。
#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; }