C语言输入一个数输出它是几位数并逆序输出
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 10:58:31
#includemain(){inti=0,s=0,n;scanf("%d",&n);while(n>0){s+=n%10;i++;n/=10;}printf("%d%d\n",s,i);}
main(){longinta;intb,c,d,e,f;scanf("%ld",&a);while(a>=1&&a=1&&a/10000=1&&a/1000=1&&a/100=1&&a/10=1&&
#includevoidmain(){intx,a,b,c;scanf("%d",&x);a=x/100;b=x/10%10;c=x%10;x=c*100+b*10+a;printf("%d",x);
intfun(intn){returnn%2;}intmain(){intn;printf("\n输入要判断的整数");scanf("%d",&n);if(fun(n)==0)printf("\n%d
int类型所能容纳的数字位数不能超过10.我写的这个程序稍微长了点,但不受int类型容量的限制,能够处理很长的整数输入(由buffer数组的大小决定).这程序只处理纯整数输入.有疑问尽管问. 
给你写了个,运行通过,你看看吧,记得采纳哦O(∩_∩)O~#includeintmain(){\x09intnum,i=0;\x09printf("pleaseinputanumble:");\x09
#includeintmain(){\x05inti,k=0;\x05for(scanf("%d",&i);i;i=i/10)\x05\x05k++;\x05printf("是%d位数",k);\x0
一直除十直到为0再答:除一次,i++再问:i=1,然后每除10,i+1?再答:开始0再问:令I=0,然后除以10,直到原数为0,最后输出I?再答:对
#includevoidmain(){inti,j,k,m,n;printf("inputanumber:\n");scanf("%d",&n);i=n/1000;j=(n%1000)/100;k=(
#includeintmain(void){longintx;inty,i=1;printf("请输入一个不超过100000的整数:");//99999||x
#include<stdio.h>#define N 5int main(){ int len(int
charsNum[8];intnumber=0;intnCount=0;cin>>number;charstring[25];memset(string,0,25);itoa(number,strin
#includeintmain(){inti=1;longnum;//int的范围是-32768~32767,这里要用long型才够longn;//复制numinta,b,c,d,e;scanf("%
#include#includeintmain(){longintnum;intindiv,ten,hundred,thousand,ten_thousand,place;printf("intput
x%10=a1,x/10%10=a2,x/100=a3,a=a1*100+a2*10+a3再答:判断是几位:if(a>100)3if(a>1000)4if(a>10000)5再问:再问:能帮我看一下错
#include#includevoidmain(void){inti,j,k,f,z;scanf("%d",&i);if(i
#include"stdio.h"voidmain(){intx,a,b,c,d,e,n,j;printf("请输入一个不多于5位的正整数\n");scanf("%d",&x);a=x/10000;b
不明白楼主让用C语言,大家怎么都用C++ #include<stdio.h>void main(){ int num,temp,number=0,s
#include#defineMAXN20intmain(){intn,t,k=0;intia[MAXN];printf("请输入一个整数:");scanf("%d",&n);while(t=n%10
#include#includeintmain(void){\x09intnum;\x09do\x09{\x09\x09printf("请输入一个不大于四位的数据:\n");\x09\x09scanf