#define _CRT_SECURE_NO_WARNINGS标签:12,正整数,入门,no,int,练习,while,num,printf From: https://blog.51cto.com/u_15866017/5951155
#include <stdio.h>
int main()
{
int no;
int num = 0;
do
{
printf("请输入一个正整数:");
scanf("%d", &no);
if (no <= 0)
printf("请不要输入一个非正整数");
} while (no <= 0);
printf("%d的位数是",no);
while (no > 0)
{
no = no / 10;
++num;
}
printf("%d", num);
putchar('.');
return 0;
}