输入一个字符串,过滤此串,只保留串中的字母字 符,并统计新生成串中包含的字母个数

输入一个字符串,过滤此串,只保留串中的字母字 符,并统计新生成串中包含的字母个数
/*------------------------------------------------
【程序设计】
--------------------------------------------------
功能:输入一个字符串,过滤此串,只保留串中的字母字
符,并统计新生成串中包含的字母个数.
例如:输入的字符串为ab234$df4,新生成的串为abdf .
------------------------------------------------*/
#include
#define N 80
int fun(char *ptr)
{
//
}
void yzj();
main()
{
char str[N];
int s;
printf("input a string:");
gets(str);
printf("The original string is :");
puts(str);
s=fun(str);
printf("The new string is :");puts(str);
printf("There are %d char in the new string.",s);
yzj();
}
中间是我自己写的 有错
后街小强 1年前 已收到1个回答 举报

明朝那些事儿3 花朵

共回答了15个问题采纳率:86.7% 举报

#include"stdio.h"
int fun(char a[])
{
x09int i=0,j,s;
x09while(a[i]!='')
x09{
x09x09if('a'

1年前

1
可能相似的问题
Copyright © 2024 YULUCN.COM - 雨露学习互助 - 17 q. 0.039 s. - webmaster@yulucn.com