?? convert.cpp
字號(hào):
//十進(jìn)制數(shù)轉(zhuǎn)換成八進(jìn)制數(shù)convert.cpp
#include<iostream.h>
#include<iomanip.h>
#include<malloc.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
typedef int Status;
typedef int SElemType;
#include "stack.cpp"
void conversion()
{SqStack *S;
SElemType e;
int n;
S->InitStack(&S);
printf("輸入十進(jìn)制數(shù):");cin>>n;
if(n<0)
{ printf("\n數(shù)必須大于零!\n");
return;}
if(!n) S->Push(0);
while(n){
S->Push(n%8);n=n/8;}
printf("結(jié)果是:");
while(!S->StackEmpty()){
S->Pop(&e);
printf("%d",e);}
}
void main()
{ printf("convert.cpp運(yùn)行結(jié)果:\n");
conversion();
getch();}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -