异常 try { 被检查的语句 } catch(异常信息类型[变量名]) { 进行异常处理的语句 } #include <math.h> #include <iostream> using namespace std; double triangle(double a, double b, doub ...
分类:
其他好文 时间:
2021-05-25 18:14:25
阅读次数:
0
C++ 获取GUID #include <objbase.h> #include <stdio.h> //--生成GUID const char* newGUID() { static char buf[64] = {0}; GUID guid; if (S_OK == ::CoCreateGuid ...
分类:
编程语言 时间:
2021-05-25 18:10:12
阅读次数:
0
C语言 #include "stdbool.h" #define NULL ((void *)0) //Definition for a binary tree node. struct TreeNode { int val; struct TreeNode *left; struct TreeNo ...
分类:
编程语言 时间:
2021-05-25 17:51:01
阅读次数:
0
#include<bits/stdc++.h> using namespace std; typedef long long ll; namespace MCMF { const int MAXN = 10000, MAXM = 10000, INF = 0x7fffffff; int head[M ...
分类:
其他好文 时间:
2021-05-25 17:42:56
阅读次数:
0
O(logn)最长上升子序列并输出 +++ pre数组记录转移。 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int N = 1e6 ...
分类:
其他好文 时间:
2021-05-25 17:36:48
阅读次数:
0
1、 利用浮点进行循环的时候,计算机不能保证计算机内部转换为二进制后不发生数据丢失,因此随着循环的进行,会发生误差的积累。 #include <stdio.h> int main(void) { int i; float x1 = - 0.01, x2; for(i = 0; i <= 100; i ...
分类:
编程语言 时间:
2021-05-24 17:20:46
阅读次数:
0
原题链接 题意:给出 \(|s| \lesqlant 1500\) 并且给出哪些字母是好哪些是坏,然后要求求出一共有多少本质不同的字串,使得坏串个数不超过 \(k\) 个。 题解:显然可以直接 \(n^2\) 暴力找然后,用字符串 \(Hash\) 判重。 代码: #include <bits/st ...
分类:
其他好文 时间:
2021-05-24 17:09:10
阅读次数:
0
1.1 Django路由分发 # mysite/urls.py from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls) ...
分类:
其他好文 时间:
2021-05-24 17:08:46
阅读次数:
0
更相减损术 #include <stdio.h> int main(void) { int a = 0, b = 0, cnt = 0, min = 0, max = 0, sub = 1; scanf("%d%d", &a, &b); while(!(a & 0x1) && !(b & 0x1)) ...
分类:
编程语言 时间:
2021-05-24 17:03:25
阅读次数:
0
let 和 const:let 和 const 都是是块级变量声明的方式,没有变量提升。let 声明的变量不能重复声明,后续可修改变量值;const 声明的是常量,后续不可修改变量值 箭头函数:箭头函数中的 this 指向,不会随着调用环境的变化而变化,是在 定义的时候 决定的,比如,一个箭头函数在 ...