早教吧作业答案频道 -->其他-->
读入一个三位长度的整数,编写程序,求出这个数的个位,十位,百位上的数字,按百位,十位,个位的顺序输出.#includeusingnamespacestd;intmain(){inta,b,c,d;couta;b=(a-c*10-d*1)/100;c=(a-b*100-d*1)/10;d=(a-b*100-c*10)/1
题目详情
读入一个三位长度的整数,编写程序,求出这个数的个位,十位,百位上的数字,按百位,十位,个位的顺序输出.
#include
using namespace std;
int main()
{
int a,b,c,d;
couta;
b=(a-c*10-d*1)/100;
c=(a-b*100-d*1)/10;
d=(a-b*100-c*10)/1;
a=b*100+c*10+d*1;
cout
#include
using namespace std;
int main()
{
int a,b,c,d;
couta;
b=(a-c*10-d*1)/100;
c=(a-b*100-d*1)/10;
d=(a-b*100-c*10)/1;
a=b*100+c*10+d*1;
cout
▼优质解答
答案和解析
是没有初始化的问题;
在前面加上这个就对了;
b = 0;
c = 0;
d = 0;
在前面加上这个就对了;
b = 0;
c = 0;
d = 0;
看了 读入一个三位长度的整数,编写...的网友还看了以下: