
字符串
文章平均质量分 87
最爱林丽明小姐
最爱林丽明小姐
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C++中string的成员函数
C++中string的成员函数string类的构造函数:string(const char *s); //用c字符串s初始化string(int n,char c); //用n个字符c初始化此外,string类还支持默认构造函数和复制构造函数,如string s1;string s2="hello";都是正确的写法。当构造的string太长而无法表达时会抛转载 2013-08-20 09:59:52 · 821 阅读 · 0 评论 -
UVa - 10878 - Decode the tape
题目大意:此题只有一组数据,| o . o|旁边两个'|'不用管, 中间的点也忽略,都别管。就管中间的其他8个字符。‘ ’代表0, ‘o’代表1。如上图可看为01000001,这为二进制, 化为十进制为65, 对应字符‘A’。既输出的第一个字母。其他每行都代表一个字母,计算后输出就行。#include#include#include#includeusi原创 2013-08-05 19:49:40 · 779 阅读 · 0 评论 -
UVa - 409 - Excuses, Excuses!
题目大意:找出输入的借口中拥有借词数最多的接口,输出。注意:同个借词出现多次按多次算==========还有每个案例后加空格#include#include#include#include#includeusing namespace std;int main(){ int n, m, arr[25], max; int i, j, k, h = 0; char原创 2013-08-05 17:50:14 · 706 阅读 · 0 评论 -
UVa - 10010 - Where's Waldorf?
题目大意:在一个m * n的字符矩阵中查找字符串s的s[0]的位置, s 在矩阵中必须是直线(8个方向都可)。还有不分大小写==============每个样例之间空行 Where's Waldorf? Given a m by n grid of letters, ( ), and a list of words, find原创 2013-08-04 15:06:53 · 765 阅读 · 0 评论 -
Pseudo-Random Numbers
Pseudo-Random Numbers #include#include#include#include#define N 10100using namespace std;int arr[N];int main(){ int z, i, m , l, ans, h = 0; while (scanf("%d%d%d%d", &z, &i, &m, &原创 2013-07-29 16:24:50 · 941 阅读 · 1 评论 -
DNA Consensus String
Figure 1.DNA (Deoxyribonucleic Acid) is the molecule which contains the genetic instructions. It consists of four different nucleotides, namely Adenine, Thymine, Guanine, and Cytosine as原创 2013-08-01 09:23:05 · 797 阅读 · 0 评论 -
UVA 401 Palindromes
题目大意:判断回文串跟镜像串,如不是回文输出is not a palindrome是回文但不是镜像输出is a regular palindrome.是镜像但不是回文输出is a mirrored string.是镜像是回文输出is a mirrored palindrome.注文章中的表格为对应的镜像字符, 还有0可视为O Palindr原创 2013-08-01 10:20:07 · 770 阅读 · 0 评论 -
UVa - 644 - Immediate Decodability
题目大意:判断一组数据中, 是否有前缀,有的就输出is not immediately decodable没有的就输出immediately decodable。#include#include#include#include#define N 1010using namespace std;struct S{ char arr[20];};S原创 2013-08-06 17:11:41 · 821 阅读 · 0 评论 -
Factoring Large Numbers
Factoring Large NumbersOne of the central ideas behind much cryptography is that factoring large numbers is computationally intensive. In this context one might use a 100 digit number that was a原创 2013-07-29 20:03:33 · 793 阅读 · 1 评论 -
UVa - 10361 - Automatic Poetry
题目大意:如:输入s1 s3 s5s6 ...则我们要输出:s1 s2s3 s4s5s6 s4s3 s2s5Automatic PoetryInput: standard inputOutput: standard outputTime Limit: 2 secondsMemory Limit: 32 MB “Oh God”, Lar原创 2013-08-04 14:38:57 · 757 阅读 · 0 评论 -
UVa-10815 - Andy's First Dictionary
题目大意:读入一段文章,不区分大写写,最后把所有的单词按小写字典序输出,。注:相同的单词只输出一遍。#include#include#include#include#include#includeusing namespace std;int main(){ char arr[20]; int i = 0; char c; set str; set::it原创 2013-08-06 15:16:53 · 698 阅读 · 0 评论