当前位置:网站首页>Intercept string (function)
Intercept string (function)
2022-06-11 15:19:00 【Psychic hacker】
Title Description
Programming , Its effect is , From string 1 ( The length exceeds 30) Of the index Copy all characters starting with characters , Generate a new string 2.
Input
Number of groups of test data n
The first set of data
The second set of data
........
Output
The substring will be output after successful generation , Failed to generate , Output "IndexError"
sample input
3
Zhenshen University
9
www.szu.edu.cn
12
apple
8
sample output
University
cn
IndexError
Code
#include<iostream>
#include<string>
using namespace std;
int main()
{
int t,i;
string a;
cin>>t;
while(t--)
{
getchar();
getline(cin,a);
int index;
cin>>index;
if(index>=a.size())
cout<<"IndexError"<<endl;
else
{
for(i=index;a[i];i++)
cout<<a[i];
cout<<endl;
}
}
}边栏推荐
- IDEA2021.1版本安装教程
- Hamad application layout scheme of hashicopy 01
- Iclr2022| small sample fine tuning method of language model based on differentiable hints
- leetcode 120. 三角形最小路径和
- 3年亏损136亿,上市能救活威马吗?
- File is in use and cannot be renamed solution
- [mysql_11] addition, deletion and modification of data processing
- How about art plus online school? Is it a new online organization?
- What is excess product power? Find the secret key of the second generation cs75plus in the year of the tiger
- 07 _ Functions and disadvantages of row lock: how to reduce the impact of row lock on performance?
猜你喜欢

C language simple webserver

Illustration of tiger international quarterly report: revenue of USD 52.63 million continued to be internationalized

Don't you understand the design and principle of thread pool? Break it up and crush it. I'll teach you how to design the thread pool

Devil cold rice # 037 devil shares the ways to become a big enterprise; Female anchor reward routine; Self discipline means freedom; Interpretation of simple interest and compound interest

05 _ 深入浅出索引(下)

【SystemVerilog 之 验证】~ 测试平台、硬件设计描述、激励发生器、监测器、比较器

Backtracking / solution space tree permutation tree

Station B executives interpret the financial report: the epidemic has no impact on the company's long-term development, and the video trend is irresistible
[mysql_12] MySQL data types

High number_ Chapter 6 infinite series__ Marklaurin series
随机推荐
回溯法/解空间树 排列树
NVIDIA R & D director: how does AI improve chip design?
做自媒体剪辑真的能挣钱吗?
当开源遇见 KPI,全球化 VS 本土化,开源的理想与现实该如何和解?
Learnopongl notes (IV) - Advanced OpenGL II
数据库优化
Exporting data using mysqldump
Hamad application layout scheme 05 of hashicopy (visit the web page)
Mysql database optimization details
在微服务架构中管理技术债务
思科瑞递交科创板注册:拟募资6亿 年营收2.22亿
How to play seek tiger, which has attracted much attention in the market?
容易让单片机程序跑飞的原因
Repository Manager之Nexus配置yum仓库
File is in use and cannot be renamed solution
safePoint讲解及其安插思路分析
19. 二叉搜索树的插入删除修剪
[verification of SystemVerilog] ~ test platform, hardware design description, excitation generator, monitor and comparator
Qualcomm WLAN framework learning (29) -- 6GHz overview
06 _ 全局锁和表锁 :给表加个字段怎么有这么多阻碍?