摘要:
Description:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S=... 阅读全文
摘要:
Description:Write a function to find the longest common prefix string amongst an array of strings.(最长公共字串)Code:string merge(string&str1, string&str2) ... 阅读全文
摘要:
Description:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeatin... 阅读全文
摘要:
Description:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Code1:vector g... 阅读全文
摘要:
Description:Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n =... 阅读全文
摘要:
一. strcpy函数原型声明:char *strcpy(char* dest, const char *src);头文件:#include 和 #include 功能:把从src地址开始且含有NULL结束符的字符串复制到以dest开始的地址空间说明:src和dest所指内存区域不可以重叠且des... 阅读全文
摘要:
1. 使用atoi函数原型:int atoi(const char*nptr);头文件:stdlib.h示例:#include #include int main(void){ int n; char *str = "12345.67"; n = atoi(str); pr... 阅读全文
摘要:
1. 使用itoa函数char *itoa(int value, char *string,int radix);原型说明:value:欲转换的数据。string:目标字符串的地址。radix:转换后的进制数,可以是2进制、8进制、10进制、16进制等。Exmaple:#include #inclu... 阅读全文