文章
3
粉丝
158
获赞
0
访问
42.1k
#include <stdio.h>
#include <string.h>
int main(int argc, const char * argv[])
{
char s[100],shuzi[100],zimu[100],fuhao[100];
gets(s);
unsigned long x=strlen(s);
int a=0,b=0,c=0;
for (int i=0; i<x; i++)
{
if (s[i]>='0'&&s[i]<='9')
{
shuzi[a]=s[i];
a++;
}
else if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='z'))
{
zimu[b]=s[i];
b++;
}
else
{
fuhao[c]=s[i];
c++;
}
}
printf("%s\n",zimu);
printf("%s\n",shuzi);
printf("%s\n",fuhao);
return 0;
}
登录后发布评论
暂无评论,来抢沙发