- 博客(5)
- 收藏
- 关注
原创 C语言 用栈进行数制转换
#include"stdio.h" #include"stdlib.h"#define null 0 #define n 10 struct stack { int *base; int *top; int stacksize;};void initstack(struct stack *s){ s->base = (int*)malloc(20 * sizeof(int)); if (!s) exit(0); s->top = s->base; s->
2020-11-26 13:11:04 1889
原创 利用栈写一个程序将读入的一个以“@”为结束符的字符序列逆序输出
#include"stdio.h" #include"stdlib.h"#define null 0 #define n 10 struct stack { int *base; int *top; int stacksize;};void initstack(struct stack *s){ s->base = (int*)malloc(20 * sizeof(int)); if (!s) exit(0); s->top = s->base; s-&g
2020-11-26 13:09:40 1929
原创 C语言顺序表操作 初始化/插入/判空/长度、元素位置/输出/删除/销毁
#include <stdio.h>#include <malloc.h>#define MaxSize 50typedef char ElemType;typedef struct{ ElemType data[MaxSize]; int length;} SqList;//创建表void InitList(SqList *&L){ L = (SqList *)malloc(sizeof(SqList)); L->length = 0;
2020-11-20 12:35:27 5307 3
原创 C语言单链表练习,插入/删除/查找最大最小值/求平均值
#include <stdio.h>#include <stdlib.h>#include <malloc.h>#define NULL 0#define LEN sizeof(struct student)struct student{ long num; float score; struct student* next;};int n;struct student* creat(void){ struct student* p1,
2020-11-15 16:45:36 1655
原创 Java计算两个矩形的面积和周长
//计算两个矩形面积和周长import java.util.Scanner;class Rectangle { double area, girth; Rectangle(double a, double b) { area = a * b; girth = (a + b) * 2; }}public class Rect { public static void main(String[] args) { do
2020-11-11 22:28:57 1526
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人