设为首页收藏本站

Crossin的编程教室

 找回密码
 立即加入
查看: 78654|回复: 0
打印 上一主题 下一主题

【每日一坑 3】 找数字

[复制链接]

0

主题

0

好友

79

积分

注册会员

Rank: 2

楼主
发表于 2013-12-17 23:57:51 |显示全部楼层

回帖奖励 +5

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <sys/types.h>

  4. int main(int argc, const char *argv[])
  5. {
  6.   char *s;
  7.   int len;

  8.   s = "aAsmr3idd4bgs7Dlsf9eAF";
  9.   len = strlen(s);

  10.   int i;
  11.   for (i = 0; i < len; i++)
  12.   {
  13.     if (isdigit(s[i]))
  14.       printf("%c", s[i]);
  15.   }

  16.   printf("\n");

  17.   return 0;
  18. }
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即加入

QQ|手机版|Archiver|Crossin的编程教室 ( 苏ICP备15063769号  

GMT+8, 2024-5-8 20:54 , Processed in 0.025024 second(s), 23 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部