直接除一下不就知道了(int)146 / 100 =1;

解决方案 »

  1.   

    除十取余啊,直至商为零。或者atoi(),然后取就是了。嘿嘿
      

  2.   

    取余数嘛.
    int n = 479;
    int x1 = n % 10;              // 个位数 OK
    int x2 = n / 10 % 10;         // 十位数 OK
    int x3 = n / 100 % 100;       // 百位数 OK
    ...
      

  3.   

    sorry...多写了一个0 ^_^int x3 = n / 100 % 10;      // 百位数 OK
      

  4.   

    int yourNumber;
    int tmp=yourNumber;
    int bitNum;
    while(yourNumber){
       bitNum=tmp%10;
       tmp=tmp/10;
    }
    顺序是从个位到高位.....
      

  5.   

    不好意思,打措了:
    int yourNumber;// maybe parameterint tmp=yourNumber;
    int bitNum;
    while(tmp){
      bitNum=tmp%10;
      tmp=tmp/10;
    }
    顺序是从个位到高位.....
      

  6.   

    #include<stdio.h>
    #include<math.h>
    main()
    {
    long m;
    int i,a,b;
    clrscr();
    scanf("%ld",&m);
    b=log10(m)+1; /* 得到m的位数,存放入变量b */
    for(i=1;i<=b;i++){
     a=(int)((m%(long)pow10(I))/(long)pow10(I-1));
     printf("%d\n",a);
    }
    printf("\n");
    for(i=b;i>0;i--){
     a=(int)((m%(long)pow10(I))/(long)pow10(I-1));
     printf("%d\n",a);
    }
    }