#includevoid main(){int i,d,m,n;char s[8]={'0'};scanf("%d",&n);i=0;do{m/8;d=n%8;s[i]='0'+d;i++;n=m;}while(n!=0);for(i=7;i>=0;i--)putchar(s[i]);}

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 02:55:39
#includevoidmain(){inti,d,m,n;chars[8]={''0''};scanf("%d",&n);i=0;do{m/8;d=n%8;s[i]=''0''+d;i++;n=m;}whi

#includevoid main(){int i,d,m,n;char s[8]={'0'};scanf("%d",&n);i=0;do{m/8;d=n%8;s[i]='0'+d;i++;n=m;}while(n!=0);for(i=7;i>=0;i--)putchar(s[i]);}
#includevoid main(){int i,d,m,n;char s[8]={'0'};scanf("%d",&n);i=0;do{m/8;d=n%8;
s[i]='0'+d;i++;n=m;}while(n!=0);for(i=7;i>=0;i--)putchar(s[i]);}

#includevoid main(){int i,d,m,n;char s[8]={'0'};scanf("%d",&n);i=0;do{m/8;d=n%8;s[i]='0'+d;i++;n=m;}while(n!=0);for(i=7;i>=0;i--)putchar(s[i]);}
结果为:n不断地除以8,得到多个余数的倒序显示.