- 博客(28)
- 收藏
- 关注
原创 安装node和npm
它维护了一个 APT 软件源,其中包含了很多 Node.js 版本。如果你的应用需要指定版本的Node.js 版本,使用这个软件源。这个脚本将会添加 NodeSource 的签名 key 到你的系统,创建一个 apt 源文件,安装必备的软件包,并且刷新 apt 缓存。如果你需要另外的 Node.js 版本,例如12.x,将setup_14.x修改为setup_12.x。03.验证 Node.js 和 npm 是否正确安装。从 NodeSource 中安装 Node.js 和 npm。
2023-06-18 15:52:55
1356
原创 使用Dialog的易错点
container和panel在actionListener的添加顺序上有区别panel的添加位置没什么限制而container在添加监听事件时必须添加在container.add()之前,否则会无效import javax.swing.*;import javax.swing.table.DefaultTableModel;import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.Actio
2021-12-26 12:14:47
328
原创 Java Swing的基本页面搭建
之前每次上手都要花好长时间将基本页面弄出来,太折磨人了,所以先贴一个基本页面慢慢再修改import javax.swing.*;import java.awt.*;public class mainPage extends JFrame{ public static void main(String[] args) { JFrame frame = new JFrame("购买商品页面"); frame.setBounds(50,50,500, 550);
2021-12-25 22:02:45
631
原创 ajax学习笔记
创建ajax对象var xhr=new XMLHttpRequest();告诉ajax请求地址以及请求方式xhr.open('get','http://www.example.com');发送请求xhr.send();获取服务器端给与客户端的相应数据xhr.onload=function(){ console.log(xhr.responseText);}注意:以上几条都在html文件中的script部分完成创建路由路径(/first)//引入express框架const
2021-05-04 11:28:31
140
原创 全局变量_
;代码转换include irvine32.inc.data tab dword 10 dup(?)x dword 5min dword ?.code main proc mov min,0 call input call find xor eax,eax neg min mov eax,min call writeint exitmain endpinput proc ;子程序:输入到对应数组 push esi push eax xor esi,esih
2021-04-25 09:19:36
148
原创 汇编 w5-1
;代码转换include irvine32.inc.data dat word 10 dup(?) ;对于这个参数设计模式不太明白p word 10 dup(?)no word ?.code main proc call input push lengthof dat push offset dat call judge call output exitmain endpinput proc ;子程序:输入数组 push esi push ecx push ebx
2021-04-25 09:17:29
144
原创 Express学习笔记
Express框架特性:提供了方便简介的路由定义方式对获取HTTP参数请求进行了简化处理提供了中间件机制有效控制HTTP请求拥有大量第三方中间件对功能进行扩展一、基本使用方法const express = require('express'); //引入express框架const app = express(); //创建web服务器app.get('/', (req, res) => { res.send('Hello express');})app.listen(
2021-04-24 17:29:47
243
原创 tree mode ver 2
using namespace std;typedef struct Node{ int elem; int length; Node(int e=0,int l=0):elem(e),length(l){}}node;vector<node> g[100005];long long int total[100005],dist[100005];int f[100005];long long int maxi;void search(int n){ if(g[n].si
2020-10-25 20:16:34
137
原创 tree modehaha ver1
#include<iostream>using namespace std;int r[10001],l[10001],point[10001];int mark[10001]={0},cc=0;int height(int x){ if(x==-1) return -1; int lh=height(l[x]); int rh=height(r[x]); if(lh>rh) return ++lh; else return ++rh;}void inorder(i
2020-10-25 20:15:19
126
原创 duidie
在这里插入代码片#include<iostream>#include<cstdio>#include<algorithm>using namespace std;typedef struct ha{ int num;//编号 int maxi;int mini; int val;}haha;bool cmp(haha a1,haha b1){ return a1.num<b1.num;}haha a[100001];int main
2020-10-05 20:20:21
115
原创 week2 no1modified
#include<cstdio>#include<cstdlib>#include<iomanip>#include<iostream>using namespace std;typedef double ListItem;typedef ListItem* addr;typedef struct alist *List;typedef struct alist{ int n,curr; int maxsize; ListItem *t
2020-09-13 23:35:39
88
原创 有史以来最长的代码 第二周第一题
#include<cstdio>#include<cstdlib>#include<iomanip>#include<iostream>using namespace std;typedef struct node *link;typedef struct node{ double a1; int b1; link next;}Node;link NewNode(){ return (link)malloc(sizeof(Node)
2020-09-13 18:56:30
7007
6
原创 第二周第二题
#include<iostream>#include<algorithm>#include<cstdio>using namespace std;typedef struct node{ int x;int y;int h;}Node;Node save[4001];int a[6001]={0};int cc[12001]={0};int c=0;int max(Node a[],int n){ int i; int maxx=a[0].y
2020-09-12 23:20:08
122
原创 第二周作业
#include<cstdio>#include<cstdlib>#include<iomanip>#include<iostream>using namespace std;typedef double ListItem;typedef ListItem* addr;typedef struct alist *List;typedef struct alist{ int n,curr; int maxsize; ListItem *t
2020-09-12 17:15:32
96
原创 7-28 格斗吧(20) (10分)
7-28 格斗吧(20) (10分)小李闲着无聊设计了一个平面打斗游戏中,在这个游戏里面任何的角色(Role)都有血量(blood)和位置loc(此处loc是Location类的实例)属性。 有了Role类,可以派生出不同的角色,如人、神仙、怪兽等。首先,定义了Location类和Role类,人类(Human)中新增了姓名和攻击力数据成员,请为Human类设计成员函数,并实现Role类中的moveTo和addBlood两个成员函数。class Location{private:int x, y;
2020-08-12 16:35:39
219
1
原创 没写完的代码
在这里插入代码片#include<iostream>using namespace std;class Group{ protected: int length;char type; public: virtual void play()=0; virtual void set()=0; Group(){} Group(char type,int length): type(type),length(length){ }};class BoyGro
2020-08-12 11:13:10
166
原创 没写完的代码先搁着
#include <iostream>using namespace std;struct Task{ int ID;//任务编号 int key;//任务优先级 int load;//任务持续时间 Task *next;};Task* getBatch(int count){int i,key1; Task *head,*p,*q;cin>>key1; head=new Task; cin>>head-&
2020-08-03 23:19:32
164
原创 函数17题
#include<iostream>#include <string>using namespace std;static float line=0;class Student{ protected: string num;string name; public: Student(string num1,string name1):num(num1),name(name1) {} virtual void display()=0;};class G
2020-08-02 09:02:15
174
原创 7-9 数据的间距问题(重载+函数模板) (60分)
7-9 数据的间距问题(重载+函数模板) (60分)三个类如下设计:类cTime有三个数据成员,hh,mm,ss,分别代表时,分和秒,并有若干构造函数和一个重载-(减号)的成员函数。类point有两个数据成员,x,y分别坐标,并有若干构造函数和一个重载-(减号)的成员函数。类date有三个数据成员,year,month,day分别代表年月日,并有若干构造函数和一个重载-(减号)的成员函数。 要求设计一个函数模板template <\class T>\ double dist(T a, T b)
2020-06-17 11:28:15
992
原创 7-7 函数模板 (10分)
7-7 函数模板 (10分)数据的间距问题(函数模板) 类point有两个数据成员:x和y, 分别代表x坐标和y坐标,并有若干构造函数和一个重载-(减号,计算两点距离)的成员函数。 要求设计一个函数模板template < class T >double dist(T a, T b)对int,float,point或者其他类型的数据,返回间距。输入格式:每一行为一个操作,每行的第一个数字为元素类型,1为整型元素,2为浮点型元素,3为point类型,若为整型元素,接着输入两个整型数据,
2020-06-17 10:26:14
1270
原创 7-2 编写一个友元函数,求两个日期之间相差的天数。 (10分)
7-2 编写一个友元函数,求两个日期之间相差的天数。 (10分)设计一个日期类Date,包括日期的年份、月份和日号,编写一个友元函数,求两个日期之间相差的天数。该类中设计有3个友元函数;count_day()函数,它有两个参数,第2个参数是一个标志,当其值等于1 时,计算一年的开始到某日期的天数;否则计算某日期到年尾的天数。leap()函数用于判断指定的年份是否为闰年。subs()函数用于计算两个日期之间的天数。 当时间输入不正确时,输出“time error!”输入样例:在这里给出一组输入。例如:
2020-06-16 22:02:34
1403
原创 7-1 宿舍谁最高? (20分)
7-1 宿舍谁最高? (20分)学校选拔篮球队员,每间宿舍最多有4个人。现给出宿舍列表,请找出每个宿舍最高的同学。定义一个学生类Student,有身高height,体重weight等。输入格式:首先输入一个整型数n (1<=n<=1000000),表示n位同学。紧跟着n行输入,每一行格式为:宿舍号,name,height,weight。宿舍号的区间为[0,999999], name 由字母组成,长度小于16,height,weight为正整数。输出格式:按宿舍号从小到大排序,输出每
2020-06-15 15:00:44
2109
原创 6-4 翻转链表(C++版) (25分)
6-4 翻转链表(C++版) (25分)本题要求实现翻转一个链表的功能。链表类ListNode的定义已经给出。要求在Solution类中给出有关函数的实现。输入样例:1081 70 49 70 88 84 51 65 60 59输出样例:59 60 65 51 84 88 70 49 70 81只有23分,有一个数据点答案错误,希望大家指正#include<iostream>using namespace std;class ListNode{public: in
2020-06-14 12:45:36
1210
3
原创 6-6 结构体数组中查找指定编号人员 (10分)
6-6 结构体数组中查找指定编号人员 (10分)人员的记录由编号和出生年、月、日组成,N名人员的数据已在主函数中存入结构体数组std中,且编号唯一。 函数fun的功能是:找出指定编号人员的数据,作为函数值返回,由主函数输出,若制定编号不存在,返回数据中的编号为空串。太坑了错误1 如果找不到对应编号,直接给字符数组赋值字符数组不像string类一样能直接赋一个字符串。要想实现,必须用strc...
2020-05-07 13:08:10
3576
原创 巧妙方法——
```cppint max(int a,int b){ if(a>=b) return a; else return b;}int min(int a,int b){ if(a<=b) return a; else return b;}int sum(int a,int b){ return a+b;}int compute(int a,int b,in...
2020-04-24 00:29:56
142
原创 2-3 最少分成几组
3 最少分成几组 (100分)给定一个包含n个数的数列,由a1,a2,…,an组成,现在将这n个数分成若干组,使得每组中任意两个数|ai-aj|>1,(i!=j)。这个数列中的n个数最少可以分成几组呢?输入格式:第一行包含一个整数n(1≤n≤1000)。 第二行包含n个整数a1,a2,…,an(1≤ai≤10000,所有ai互不相同)。输出格式:输出仅一个整数,表示数列中n个数最少...
2020-04-09 16:39:04
425
原创 后缀表达式
5 后缀表达式 (100分)所谓后缀表达式是指这样的一个表达式:式中不再引用括号,运算符号放在两个运算对象之后,所有计算按运算符号出现的顺序,严格地由左而右进行(不用考虑运算符的优先级)。如:中缀表达式 3*(5–2)+7 对应的后缀表达式为:352-*7+ 。请将给出的中缀表达式转化为后缀表达式并输出。输入格式:输入仅一行为中缀表达式,式中所有数字均为个位数,表达式长度小于1000。...
2020-03-27 19:23:59
2709
原创 二分查找法
二分查找法。按照从小到大的顺序,输入n个整数并存入数组a中,然后在数组a中查找给定的x。如果数组a中的元素与x的值相同,输出相应的下标(下标从0开始);如果没有找到,输出“Not Found”。如果输入的n个整数没有按照从小到大的顺序排列,或者出现了相同的数,则输出“Invalid Value”。1 检查数列是否完全递增2 不断将x与mid比对,调整缩小left与right的范围3 用变量f...
2020-03-07 21:25:17
8894
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人