YTU 2928: 取不重复的子串。
2928: 取不重复的子串。
时间限制: 1 Sec 内存限制: 128 MB
提交: 5 解决: 5
题目描述
输入字母构成的字符串(不大于30字符)从中读取3个不重复的字符,求所有取法,取出的字符串按升序排列。不同取法输出顺序可以不考虑。
输入
输入一串字符(不超过30个)
输出
从中读取3个不重复的字符,求所有取法,取出的字符串按升序排列。
样例输入
abcd
样例输出
abc
abd
acd
bcd
你 离 开 了 , 我 的 世 界 里 只 剩 下 雨 。 。 。
#include <stdio.h>
#include <string.h>
int main()
{
char c[99];
int i,j,k;
gets(c);
for(i=0; i<strlen(c); i++)
{
for(j=i+1; j<strlen(c); j++)
{
for(k=j+1; k<strlen(c); k++)
{
printf("%c",c[i]);
printf("%c",c[j]);
printf("%c\n",c[k]);
}
}
}
return 0;
}
YTU 2928: 取不重复的子串。的更多相关文章
- 3 Longest Substring Without Repeating Characters(最长不重复连续子串Medium)
题目意思:求字符串中,最长不重复连续子串 思路:使用hashmap,发现unordered_map会比map快,设置一个起始位置,计算长度时,去减起始位置的值 eg:a,b,c,d,e,c,b,a,e ...
- C++ string类取字符串的左右子串(以特定子串为分界限)
// Example3.cpp : 定义控制台应用程序的入口点. //以特定单词为分界,求取字符串的左右子串 #include "StdAfx.h" #include <st ...
- H - Repeats (重复最多子串的次数)
题目链接:https://cn.vjudge.net/contest/283743#problem/H 题目大意:T组数据,给你一个字符串,然后让你求这个字符串的重复最多子串的次数. 具体思路:论文题 ...
- 求一字符串最长不重复字符子串的长度【Java 版】
一. 前言 最近学习有点断断续续,整理的一些知识点要么不完整,要么完全没搞懂,不好拿上台面,还是先在草稿箱躺着吧.偶尔在浏览大牛博客http://coolshell.cn的时候,发现大牛业余时间也在做 ...
- POJ 1743 Musical Theme 后缀数组 最长重复不相交子串
Musical ThemeTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://poj.org/problem?id=1743 Description ...
- shell脚本使用技巧4--读取字符,重复执行
ls | cat -n > out.txt 给输出的信息加行号并导出到out.txt 利用shell生成一个独立的进程 pwd; (cd /bin; ls); pwd; 开启一个子shell,不 ...
- LeetCode OJ:Longest Substring Without Repeating Characters(最长无重复字符子串)
Given a string, find the length of the longest substring without repeating characters. For example, ...
- LeetCode.3-最长无重复字符子串(Longest Substring Without Repeating Characters)
这是悦乐书的第341次更新,第365篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Medium级别的第2题Longest Substring Without Repeating Cha ...
- 3. Longest Substring Without Repeating Characters - 最长无重复字符子串-Medium
Examples: Description: Given a string, find the length of the longest substring without repeating ch ...
随机推荐
- String字符串的遍历
StringTest.java /* * 变量字符串(获取字符串中的每一个字符) */ public class StringTest { public static void main(String ...
- Flash学习笔记(01)
一:动画基础原理 二:Flash的动画的制作方式 三:元件与实例的关系 四:Flash实例 可以做出网上常见的网页动画 Flash能为我们做什么 1.网站.贺卡.配乐短片.短剧.游戏.教学 ...
- luogu4135 作诗
看这里 #include <iostream> #include <cstring> #include <cstdio> #include <cmath> ...
- Python中的*arg和**kwarg
一个简单的函数 首先我们可以定一个简单的函数, 函数内部只考虑required_arg这一个形参(位置参数) def exmaple(required_arg): print required_arg ...
- xtu字符串 C. Marlon's String
C. Marlon's String Time Limit: 2000ms Memory Limit: 65536KB 64-bit integer IO format: %lld Java ...
- HDU-1087Super Jumping! Jumping! Jumping!
Super Jumping! Jumping! Jumping! ...
- 什么是Istio
本文主要是对Istio Prelim 1.0(https://preliminary.istio.io/docs/)的翻译 Istio:一种开放式平台,用于连接,管理和保护微服务. Istio提供了一 ...
- 时间戳转换成DateTime
select DateAdd(hour,8,Dateadd(ss,时间戳,'1970-01-01')) --1970/01/01+时间戳(秒数)+8小时 --因GMT是中央时区,北京在东8区,相差 ...
- hdu4085(斯坦纳树)
题意: 给你n,m,k ,分别表示有n个点,m条边,每条边有一个权值,表示修复这条边需要的代价,从前k个点中任取一个使其和后k个点中的某一个点,通过边连接,并且必须是一一对应,问最小的代价是多少. 分 ...
- Log4j的日志级别分析(转)
说明:Log4j的日志是有级别的,从低到高顺序为:ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF,当定义了日志级别为 ...