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 + ;
long long st = L % ;
if (st == ) st = ; long long now = ;
while ()
{
printf("%c", Q[st-]);
now++;
if (now == tot) break;
st++;
if (st == ) st = ;
}
printf("\n"); }
return ;
}
HUST 1602 Substring的更多相关文章
- LeetCode[3] Longest Substring Without Repeating Characters
题目描述 Given a string, find the length of the longest substring without repeating characters. For exam ...
- 最长回文子串-LeetCode 5 Longest Palindromic Substring
题目描述 Given a string S, find the longest palindromic substring in S. You may assume that the maximum ...
- POJ3693 Maximum repetition substring [后缀数组 ST表]
Maximum repetition substring Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9458 Acc ...
- [LeetCode] Longest Substring with At Least K Repeating Characters 至少有K个重复字符的最长子字符串
Find the length of the longest substring T of a given string (consists of lowercase letters only) su ...
- substring的用法
public String substring(int beginIndex, int endIndex) 返回一个新字符串,它是此字符串的一个子字符串.该子字符串从指定的 beginIndex 处开 ...
- jQuery之常用且重要方法梳理(target,arguments,slice,substring,data,trigger,Attr)-(一)
1.jquery data(name) data() 方法向被选元素附加数据,或者从被选元素获取数据. $("#btn1").click(function(){ $(" ...
- leetcode--5. Longest Palindromic Substring
题目来自 https://leetcode.com/problems/longest-palindromic-substring/ 题目:Given a string S, find the long ...
- C#和Java中的Substring()
吐槽-使用清理软件整理电脑要注意,不要清理的"太狠",不然你会受伤的! C#中的Substring() 示例 实现代码 using System;using System.Coll ...
- JavaScript中的slice,splice,substr,substring,split的区别
万恶的输入法,在sublime中会显示出繁体字,各位看官见谅. 1.slice()方法:该方法在数组和string对象中都拥有. var a = [1,2,3,4,5,6]; var s = 'thi ...
随机推荐
- db2导入表结构和表数据
http://www.cnblogs.com/kfarvid/archive/2010/12/15/1906776.html db2的博文 -bash-3.2$ db2 connect to ca ...
- POJ1182--食物链(经典并查集)并查集看不出来系列2
食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 65906 Accepted: 19437 Description ...
- Win7下用easyBCD引导安装Ubuntu15.04
1 准备工作 easyBCD中添加一个启动项 修改启动项配置文件 注意两点:C盘设备号,镜像名称 title Install Ubuntu root (hd0,) kernel (hd0,)/vmli ...
- 二叉树,平衡树,红黑树,B~/B+树汇总
二叉查找树(BST),平衡二叉查找树(AVL),红黑树(RBT),B~/B+树(B-tree).这四种树都具备下面几个优势: (1) 都是动态结构.在删除,插入操作的时候,都不需要彻底重建原始的索引树 ...
- Django: 配置和静态文件
运行django-admin.py startproject [project-name] 命令会生成一系列文件,在django 1.6版本以后的settings.py文件中有以下语句: # Buil ...
- Eclipse中Ctrl+Alt+Down和Ctrl+Alt+Up不起作用
不起作用是因为跟因特尔的快捷键冲突. 1.在桌面上右键,选择“图形属性......” 2.选择“选项和支持” 3.更改快捷键. 注意:单纯禁用英特尔的快捷键可能不起作用.
- mysql建表: 主键,外键约束
CREATE DATABASE db_studentinfo; USE db_studentinfo ; DROP TABLE IF EXISTS t_student ; CREATE TABLE t ...
- Codeforces Round #272 (Div. 1) B 构造 math
http://www.codeforces.com/contest/477/problem/C 题目大意:给你n个集合,每个集合里面有四个数字,他们的gcd是k,输出符合条件的集合中m,m为集合中最大 ...
- jquery选中checkbox多选项并添加到文本框中
<script> function check(){ var dd = ""; if($("input[type='checkbox'][name='moke ...
- TCP/IP Protocol Fundamentals Explained with a Diagram
最近准备系统学习网络相关的知识,主要学习tcp/ip, websocket 知识. 原文地址:http://www.thegeekstuff.com/2011/11/tcp-ip-fundamenta ...