Navigation

    GitHub中文社区
    • GitHub排行榜

    论坛

    • Login
    • Categories
    • Recent
    • Tags
    • Popular

    编写程序数一下1到100的所有整数中出现多少个数字9。

    综合交流
    2
    2
    237
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 150930
      150930 last edited by

      #include<stdio.h>
      int main()
      { int i,count=0;
      for(i=1;i<100;i++)
      { if(i%10==9)
      {
      printf( " %d",i);
      count++;}
      if(i/10==9)
      printf(" %d",i);
      count++;
      }
      printf(" \ncount=%d",count);
      return 0;

      }

      390538316 1 Reply Last reply Reply Quote 1
      • 390538316
        390538316 @150930 last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • First post
          Last post