- // Copyright © 2016年 yaomars. All rights reserved.
- //
- #include <stdio.h>
- int main(int argc, const char * argv[]) {
-
- printf("请输入一个整数:\n");
- int num = 0,value;
- scanf("%d",&num);
-
- if (num <= 9) {
- printf("value = %d\n",num);
- }
-
- while (num / 10) {
-
- value = num % 10;
- printf("value = %d\n",value);
- num /= 10;
-
- if (num <= 9) {
- printf("value = %d\n",num);
- break;
- }
- }
-
- return 0;
- }
复制代码
经测试 无误!! |