a.cpp
来自「该软件实现了将十进制转化为十二进制」· C++ 代码 · 共 31 行
CPP
31 行
#include<iostream.h>
main()
{
int m;
cout<<"put in the number of m"<<endl;
cin>>m;
int t=12;
int n=1;
while(m>=t)
{
t=t*12;
n++;
}
int w[32];
for (int i=0;i<n;i++)
{
w[i]=m%12;
m=m/12;
}
for (int j=n-1;j>=0;j--)
{
if(w[j]==10)//clear know the meaning of w[i] and do it in another way
cout<<'a';
else if(w[j]==11)
cout<<'b';
else
cout<<w[j];//more 检测 may something not correct
}
cout<<endl;//something know it but not clearly ,more practise may clearly
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?