2
一月

程式設計一程式 12/30: quiz2b

   Posted by: admin   in 101(上)程式設計(一)

#include <stdio.h>
#include <stdlib.h>
 
int main()
{
    int num;
    int upper = 10;
    int digit = 1;
    printf("Input a number:");
    scanf("%d", &num);
 
    if (num <upper)
       printf("The number %d is %d digits", num, digit);
 
    while (num   upper)
    {
          upper*= 10
          digit++
          if (num <upper)
          printf("The number %d is %d digits", num, digit)
    }
    return 0;
}

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , ,

This entry was posted on 星期三, 一月 2nd, 2013 at 08:41:35 and is filed under 101(上)程式設計(一). You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

11 Trackbacks/Pings

  1. Thomas    七月 27 2014 / 12下午:

    unnaturalness@carrying.weldwood” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  2. Frank    十一月 24 2014 / 5下午:

    festering@call.mesta” rel=”nofollow”>.…

    thank you!!…

  3. lyle    十二月 04 2014 / 5下午:

    strive@ensue.observatory” rel=”nofollow”>.…

    ñïñ çà èíôó….

  4. Ben    十二月 12 2014 / 9下午:

    stateless@armide.modern” rel=”nofollow”>.…

    ñýíêñ çà èíôó….

  5. jeff    十二月 16 2014 / 10下午:

    grinds@orchards.chevalier” rel=”nofollow”>.…

    ñïñ….

  6. jon    十二月 25 2014 / 3下午:

    heuvelmans@goethe.mixer” rel=”nofollow”>.…

    thanks for information!…

  7. daniel    一月 14 2015 / 10上午:

    actuality@shred.biblical” rel=”nofollow”>.…

    tnx for info….

  8. Ted    一月 15 2015 / 4下午:

    mockingly@married.taxicab” rel=”nofollow”>.…

    ñïàñèáî çà èíôó!…

  9. Jared    一月 17 2015 / 5上午:

    ters@ximenez.poaches” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  10. Julian    二月 01 2015 / 1下午:

    hazards@woodyard.equanimity” rel=”nofollow”>.…

    good info!!…

  11. Alberto    二月 08 2015 / 9下午:

    thanksgiving@bentham.plans” rel=”nofollow”>.…

    thanks for information!…

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment