当前位置: 代码迷 >> C语言 >> 弱弱的问题:字符的替换怎么实现?
  详细解决方案

弱弱的问题:字符的替换怎么实现?

热度:154   发布时间:2005-12-11 01:55:00.0
弱弱的问题:字符的替换怎么实现?
文件a.txt里是这样的:
Thx amazing story of how lxgxndary mastxr winxmakxr, Dr. Richard Pxtxrson, cultivatxd vinxs plantxd in xngland by thx Romans two thousand yxars ago and crxatxd Napa Vallxy's nxwxst, finxst sparkling winx.
所有的e都错打成了x,现在要把x改回来,C程序改如何编?(手工修改就不必了)
搜索更多相关的解决方案: 字符  

----------------解决方案--------------------------------------------------------
很简单呀,设置一个指针,如果他的值是e,那么把x赋值给他
----------------解决方案--------------------------------------------------------
我还没学到指针,麻烦大哥写一下代码。
----------------解决方案--------------------------------------------------------
char s[1100]={Thx amazing story of how lxgxndary mastxr winxmakxr, Dr. Richard
Pxtxrson, cultivatxd vinxs plantxd in xngland by thx Romans two
thousand yxars ago and crxatxd Napa Vallxy's nxwxst, finxst sparkling
winx.}
for(i=0;i<=
{if(s[i]==''&&s[i+1]=='')判断结束
return -1;
if(s[i]==x)
s[i]=e;
}
printf ......



----------------解决方案--------------------------------------------------------
  相关解决方案