题解 1680: 数据结构-八进制数

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

利用顺序栈完成进制转化

```c#include#includetypedefstructSTACK{int*base;int*top;intstacksize;}SqStack;//构造简单的顺序栈intStackEmpty(SqStack&s){if(s.base==s.top)return1;elsereturn0;}

C语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>typedef struct linkednode{    int data;    struct ……

使用%o直接输出八进制数

解题思路:在c语言里%o能直接输出八进制数注意事项:需要注意题目没有说明输入数的数目,在while循环中以EOF作为文件结束标志参考代码:#includeintmain(){intnum;while(scanf("%d",&num)!=EOF){printf("%o\n",

1680: 数据结构-八进制数

参考代码:#include#includeusingnamespacestd;intmain(){intnum;while(cin>>num){stacks;s.push(num);while(s.top()>=8){intn1=s.top();s.pop(

花落的新手代码(C语言代码)

摘要:解题思路:使用函数sprintf就可以实现进制转换。注意事项:参考代码:#include<stdio.h> #include<ctype.h> #include<string.h> #inclu……

数据结构-八进制数 (C++代码)

摘要:解题思路:使用cout输出八进制格式直接输出注意事项:参考代码:#include <iostream> using namespace std; int main () { int n; ……