首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 其他相关 >

查寻子字符串,并记录查找的第一个子字符串的位置

2013-01-02 
查找子字符串,并记录查找的第一个子字符串的位置code: https://github.com/lujinjianst/myNCCL/blob/maste

查找子字符串,并记录查找的第一个子字符串的位置

code: https://github.com/lujinjianst/myNCCL/blob/master/exercise/exercise-12.3.c

 

computational results :

 

[haoyue@centos exercise]$ ./a.out
input string s1 and s2:
hello
helloworld
helloworld is not  in hello
[haoyue@centos exercise]$ ./a.out
input string s1 and s2:
world hello
hello
hello is in world hello  ,the first position 6
[haoyue@centos exercise]$ ./a.out
input string s1 and s2:
helloworldhello
hello
hello is in helloworldhello ,the first position 0

 

以上程序存在一些弊端,大家可以进一步研究。。。


热点排行