#include <stdio.h> #include <math.h> int main(){ int N,sum_value=0,num=0; if (scanf("%d",&N)!=0 && N<=pow(10,9)){ while (N!=0){ num = num+1; sum_value = sum_value + N%10; N = N/10; } printf("%d %d",num,sum_value); }else{ printf("something wrong"); } return 0; }
c语言编程练习题:7-28 求整数的位数及各位数字之和
作者:yunjinqi
类别:编程
日期:2023-05-29 13:37:23
阅读:565 次
消耗积分:0 分
版权所有,转载本站文章请注明出处:云子量化, https://www.yunjinqi.top/article/153
最新文章
系统当前共有 404 篇文章