大神看看 哪里不对啊
vs2012吧
全部回复
仅看楼主
level 5
wdh969 楼主
#include"stdio.h"
#include"stdlib.h"
#include"string.h"
main()
{
int i,j=0;c
har ch[80];
gets(ch);
for(i=0;ch[i]!='\0';i++)
if(ch[i]<'0'||ch[i]>'9')
ch[j++]=ch[i];
ch[j]='\0';
puts(ch);
system("pause");
return;
}
2013年05月15日 03点05分 1
level 3
本人新手。include后面要用<>;main没返类型;char中间不能有回车;ch没初始化。ch[i]!='\0'第一次看到,我要研究一下;for循环是个死循环;for后面应该加{}否则不好(个人理解)。交卷
2013年05月15日 05点05分 2
for循环下标会越界
2013年05月15日 05点05分
没看到gets(ch);,新手就是新手啊
2013年05月15日 05点05分
回复 ezjf0001 :双引号也可以的啊
2013年05月15日 08点05分
level 1
如果是库函数inlude后面最好用<>,用“”影响效率,主函数没有返回值int main{.....return 0}
2013年05月16日 01点05分 3
level 5
wdh969 楼主
1>------ 已启动生成: 项目: 删除字符串中的数字, 配置: Debug Win32 ------1> 源.c1>g:\c程序\删除字符串中的数字\删除字符串中的数字\源.c(8): error C4996: 'gets': This function or variable may be unsafe. Consider using gets_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.1> e:\vs2012\vc\include\stdio.h(261) : 参见“gets”的声明========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
2013年05月16日 06点05分 4
在程序头部加上 #define _CRT_SECURE_NO_DEPRECATE
2013年06月05日 14点06分
level 5
wdh969 楼主
看不懂啊
2013年05月16日 06点05分 5
level 2
gets(ch);
改为gets_s(ch);
就行了。
2013年05月26日 15点05分 6
多谢了哈[吐舌]
2013年05月27日 01点05分
回复 wdh969 :不用客气.
2013年05月27日 08点05分
1