自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 时间差时间差

/*描述从键盘输入一个24小时制的时间,计算该时间到中等12:00的时间差,当前时间是00:00-11:59,时间差前使用-号,当前时间是12:00-23:59,时间差前不使用符号注:类名必须为Main(大写M)输入格式一个24小时制的时间输出格式输出如题描述的时间差,另外,小时和分钟都要用两位数字符显示。输入样例10:59输出样例-01:01提示例如12:32,输出00:32*/package main;import java.util.Scanner;public.

2021-06-19 16:15:10 1628

原创 Bubble

public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); String s = input.nextLine(); int cnt=0; while(s.indexOf("Bubble")>=0) {...

2021-06-15 21:17:01 80

原创 8606二叉树的构建及遍历操作

#include "stdio.h"#include "malloc.h"#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASIBLE -1#define OVERFLOW -2#include <iostream>#include <iomanip>//不要忘记包含此头文件using namespace std;typedef int Status;typed...

2021-05-11 21:42:09 177

原创 8584循环队列基本操作

#include<malloc.h>#include<stdio.h>#define OK 1#define ERROR 0typedef int Status; // Status是函数的类型,其值是函数结果状态代码,如OK等typedef int QElemType;#define MAXQSIZE 100 // 最大队列长度(对于循环队列,最大队列长度要减1)typedef struct{ QElemType *base; // 初始化的动态分配存储...

2021-05-11 19:51:38 200

原创 8581 线性链表逆置

#include<cstdio>#include<cstdlib>#define ERROR 0#define OK 1#define ElemType int//设有一线性表A=(a0,a1,..., ai,...an-1),其逆线性表定义为A'=( an-1,..., ai,...,a1, a0),设计一个算法,将线性表逆置,要求线性表仍占用原线性表的空间。typedef int Status;typedef struct LNode{ int dat..

2021-05-07 20:33:43 203

原创 java小结

声明import java.util.Scanner; 定义字符串 String s 输入字符串 s = input.nextLine(); 从一个字符串里提取第n个字符 char a; a = s.charAt(n-1); 字符串的长度 s.length(); System.out.print(s.length()); 定义数组 char[] a = new char[s.length()];...

2021-05-06 22:43:44 77

原创 8577

#include<stdio.h>#include<malloc.h>#define OK 1#define ERROR 0#define LIST_INIT_SIZE 100#define LISTINCREMENT 10#define ElemType inttypedef int Status;typedef struct{int* elem;int length;int listsize;}SqList;St..

2021-04-25 21:49:01 168

原创 矩阵乘法

package 矩阵乘法;import java.util.Scanner;public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); int m,n,p,q,temp=0; //输入的四个数分别为两个矩阵的行数和列数 System.out.println("分别输入.

2021-04-22 23:12:31 85

原创 8576顺序线性表的基本操作

#include<stdio.h>#include<malloc.h>#define OK 1#define ERROR 0#define LIST_INIT_SIZE 100#define LISTINCREMENT 10#define ElemType inttypedef struct{ int *elem; int length; int listsize;}SqList;int InitList_Sq(SqList &L){// .

2021-04-22 13:31:30 150

原创 8578顺序表逆置

#include<stdio.h>#include<malloc.h>#define OK 1#define ERROR 0#define LIST_INIT_SIZE 100#define LISTINCREMENT 10#define ElemType inttypedef int Status;typedef struct{ int *elem; int length; int listsize;}Sq.

2021-04-22 13:28:26 167

原创 8579

#include<stdio.h>#include<malloc.h>#define ERROR 0#define OK 1#define ElemType inttypedef struct LNode{ int data; struct LNode *next;}LNode,*LinkList;int CreateLink_L(LinkList &L,int n){// 创建含有n个元素的单链表 LinkList.

2021-04-22 13:26:07 143

原创 2021-04-22

//题目6在-10到10之间随机产生一个大小为8的数组,并判断有没有a+b=0的数组,记为{a,b},请输出所有的数组,且每一个数组不能重复。package main4;public class Main4 { public static void main(String[] args) { // TODO Auto-generated method stub int[] a = new int [8]; int[] b = new int [8]; int ret=0,cnt.

2021-04-22 13:14:36 71

原创 2021-04-22

//题目5//寻找一个数组的最大和的连续子数组,如数组[-2,1,-3,4,-1,2,1,-5,4]的最大和连续子数组为[4,-1,2,1]。使用random函数在-10到10之间随机产生一个大小为8的数组,并输出最大和连续子数列。package main2;import java.util.Scanner;public class Main2 { public static void main(String[] args) { // TODO Auto-generated method .

2021-04-22 13:13:40 77

原创 2021-04-22

//题目4//寻找字符串最长公共前缀,从键盘接收输入2个字符串,并输出最长公共前缀,比如''flight''与''flow''的最长公共前缀是''fl'',并输出相应的长度。package main3;import java.util.Scanner;public class Main3 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new .

2021-04-22 13:12:51 51

原创 2021-04-22

//题目三:随机生成数,求最大公约数和最小公倍数//使用Math.random()随机产生10个0到1000之间的整数,保存到一个数组中,并找出每一组(第一个数和第二数,第二个数和第三个数,依次类推)整数的最大公约数和最小公倍数。输出格式:数组第一行:数为X1和X2,最大公约数为:x3,最小公倍数为X4,然后换行,第二行:package main1;import java.util.Scanner;public class Main1 { public static void main(Str.

2021-04-22 13:11:02 74

原创 2021-04-22

//题目二:输出1000以内素数,每行6个//输出2到1000之间的所有质数,每行输出6个。package main;import java.util.Scanner;//import javax.swing.JOptionPane;public class Main { public static void main(String[] args) int i,j; int cnt=0; for(i=2;i<=1000;i++) { .

2021-04-22 13:09:55 245

原创 2021-04-22

//题目一:回文串//给出一个字符串,找回最长的回文串,且输出最长回文符及其位置。//这一题我不太会,所以有借鉴其他同学的,但现在已明白package main;import java.util.Scanner;public class Main { //构造函数判断所检索字符串是否为回文串 public static boolean TorF(String s) { int ret=1; break; for(int i=0;i<s.length...

2021-04-22 13:08:33 77

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除