登录
|
注册
公司
标签
文章
搜索
字符串
热门公司
百度
微软
腾讯
华为
阿里巴巴
迅雷
热门职位
C语言工程师
研发工程师
测试工程师
所有
有回答
没回答
新题目
有最佳答案
排序
热度
·
时间
·
经典指数
0
0
4288
下列给定程序中,函数fun的功能是;在形参s所指字符串中寻找与参数c相同的字符,并在其后插入一个与之相同的字符,若找不到相同的字符则不做任何处理。 例如,若S所指字符串为"baacda",c中的字符为a,执行后s所指字符串为"baaaacdaa". 请在程序的下画线处填入正确的内容并将下画线删除,使程序得出正确的结果。 void fun(char *s, char c) { int i, j, n; for (i = 0; s[i] != 1 ; i++) { if (s[ i ] == c) { n = 2 ; while (s[ i + 1 + n] != '\0') n++; for (j = i + n + 1; j>i; j--) s[j + 1] = s[j]; s[j + 1] = 3 ; ...
阅读题目
C语言工程师
字符串
填空题
经典指数
0
0
1419
remove掉给定字符串中的多余空格,要求达到以下要求 A.无连续相邻的两个空格 B.字符串开头和结尾无空格 C.新的一行开头和结尾无空格 ...
阅读题目
微软
字符串
问答题
经典指数
0
0
1614
在字符串S中寻找最长的字符串x,条件是x存在于S中。即是如:abcabcdcd中的abc。 ...
阅读题目
网易
字符串
问答题
经典指数
0
0
1542
注意:请尽可能详细描述你的数据结构、系统架构、设计思路等。建议多写一些伪代码或者流程说明。 1. 考虑一个字符串替换的过程,在一个文本文件中含有一些文本内容和一些需要替换的变量,变量的格式为“$Var$”,原来的“$”使用“$$”进行转义,原来的“$$”表示为“$$$”。我们将含有变量的文件称为模板(文件名为t),文本文件的平均长度为100K。另外,还有一系列的变量文件,里面为变量名和变量值的对应关系(文件名为1.v , 2.v… n.v),每个变量文件包含的变量数在百万数量级,且变量排列次序不定。现要求将,模板里的变量分别用变量文件里的变量替换,并将生成的文件写成 (1.r, 2.r… n.r)。 要求:从算法和实现上和实现技术上的细节对程序进行优化,尽量使程序高效。程序运行环境为2G内存,4CPU。阐明主要思路,给出伪码和说明,可以着重指出你使用的优化技术。 例子:模板文件为 This is an $FF$ $$. I like $FF$ and $FA$。 变量文件为 1.v FF : banana FA : apple 2.v F ...
阅读题目
百度
字符串
问答题
经典指数
0
0
1163
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the length of 1. ...
阅读题目
字符串
面试题
经典指数
0
0
4547
String str = new String(“abc”),“abc”在内存中是怎么分配的? 堆 栈 字符串常量区 寄存器 ...
阅读题目
Java
人人网
操作系统
字符串
多选题
经典指数
0
0
2005
Given a string with n characters, suppose all the characters are different from each other, how many different substrings do we have? n+1 n^2 n(n+1)/2 2^n-1 n! ...
阅读题目
微软
字符串
组合数学
单选题
经典指数
0
0
2352
把字符串转换为整数 例如:"-123" -> -123 #include #include using namespace std; int num(string str) { int num = 0; for (int i = 0; i < ___1___; i ++) { int k = ___2__; num = __3___; } return num; } int main() { string str = "-123"; int n = 0; if ( str[0] == '-' ) n = -1 * num (str.substr(1)); else n = num(str); cout ...
阅读题目
腾讯
C语言工程师
字符串
问答题
经典指数
0
0
2250
检查程序,是否存在问题,如果存在指出问题所在,如果不存在,说明输出结果。 package algorithms.com.guan.javajicu; public class Example { String str = new String(“good”); char[] ch = {‘a’, ’b’, ’c’}; public static void main(String[] args) { Exampleex = new Example(); ex.change(ex.str, ex.ch); System.out.print(ex.str + ” and ”); System.out.print(ex.ch); } public void change(Stringstr, char ch[]) { str = “test ok”; ch[0] = 'g'; } } ...
阅读题目
Java
网易
2015
字符串
问答题
经典指数
0
0
1222
Given two strings S1 and S2 , S = S1 - S2 is defined to be the remaining string after taking all the characters in S2 from S1 . Your task is simply to calculate S1 - S2 for any given strings. However, it might not be that simple to do it fast . 输入描述: Each input file contains one test case. Each case consists of two lines which gives S1 and S2, respectively. The string lengths of both strings are no more than 104. It is guaranteed that all the characters are visible ASCII codes and wh ...
阅读题目
字符串
面试题
经典指数
1
2
3
4
32
题目数
1
贡献者
212
答案数
扫描后移动端查看
我也分享一个题目
相关标签
C语言工程师
百度
查找
复杂度
研发工程师
动态规划
微软
基础知识
腾讯
华为
同类标签
树
排序
数组
链表
复杂度
查找
栈
图
哈希
队列
微信公众号
欢迎加入,一起群聊
×
登录
注册
找回密码
记住登录
登录
快速注册
直接第三方登录