⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a.cpp

📁 该软件实现了将十进制转化为十二进制
💻 CPP
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -