直接上代码 void Add(int a, double b, short c, const char * f) { std::cout << f << a << ", " << b << ", " << c << ";\n"; } void *p = nullptr; template <type ...
分类:
编程语言 时间:
2021-06-04 19:35:50
阅读次数:
0
给你两个单链表的头节点 headA 和 headB ,请你找出并返回两个单链表相交的起始节点。如果两个链表没有交点,返回 null 。 三种方法:1、暴力遍历 2、双指针(建议) 3、哈希表 1、暴力遍历 特判:如果两个链表其中一个为空,则返回空 思想:利用两个指针,A指针指向一条链表的一个节点,B ...
分类:
其他好文 时间:
2021-06-04 19:32:40
阅读次数:
0
我们只看看最基础的汉诺塔问题吧,左神的进阶问题就算了。。。:smiley: 很多人都将汉诺塔是什么,解题流程,然后一个代码就结束。 可是我对汉诺塔递归过程总是很迷惑,感觉很抽象,以下是我的理解。 比如汉诺塔的打印: public void hanoi(int n) { if (n > 0) { fu ...
分类:
其他好文 时间:
2021-06-04 19:29:33
阅读次数:
0
1、头文件<string.h> 2、函数原型void *memset(void *str, int c, size_t n) 3、功能:复制字符 c(一个无符号字符)到参数 str 所指向的字符串的前 n 个字符 链接:C 库函数 – memset() | 菜鸟教程 (runoob.com) ...
分类:
其他好文 时间:
2021-06-04 19:26:42
阅读次数:
0
#include <stdio.h>#include <unistd.h>int main(){ int i = 10; pid_t pid; printf("Father's pid:%d\n", getpid()); pid = fork(); if(pid < 0) { perror("for ...
分类:
其他好文 时间:
2021-06-04 19:24:24
阅读次数:
0
K次圆覆盖问题 模板 #include<bits/stdc++.h> using namespace std; const int maxn=1009; const double eps=1e-8; const double pi=acos(-1); int dcmp(double x) {retu ...
分类:
其他好文 时间:
2021-06-04 19:11:31
阅读次数:
0
package main import ( "fmt" "gorm.io/driver/mysql" "gorm.io/gorm" "time" ) type User struct { ID int Name string CreatedTime time.Time } func main() { ...
分类:
其他好文 时间:
2021-06-04 19:06:12
阅读次数:
0
简介 看到这个题目就想到了dp,但是这个dp状态转移方程说实话一时半会儿, 想不出来. 这个时候你可以其实可以通过画相关关系,进而得到状态转移方程. if(text1[i-1] == text2[j-1]) { dp[i][j] = dp[i-1][j-1] + 1; }else{ dp[i][j] ...
分类:
其他好文 时间:
2021-06-04 19:01:44
阅读次数:
0
abstract class Geom { getType() { return "Gemo"; } width: number; abstract getArea(): number; // 抽象方法 } class Circle extends Geom { getArea() { return ...
分类:
其他好文 时间:
2021-06-04 19:00:51
阅读次数:
0
类型转换 publicclassdemo06 { publicstaticvoidmain(String[] args) { inti=128; byteb= (byte)i;//内存溢出 byte 最大值127 //低 高 //byte,short,char,int,long,float,doub ...
分类:
其他好文 时间:
2021-06-04 19:00:16
阅读次数:
0