再次因为浮点数g++, c++编译器的问题WA,中间还因为reset没有改过来编译器无脑再WA了一次 这道题很适合Kruskal这种将最开始的联通森林,一点点聚合到一起成为一棵联通的最小生成树的想法,只不过,具体到这道题,是要将原先的p个森林,聚合成为s个森林,所以实现就非常简单了 #include ...
分类:
其他好文 时间:
2021-04-14 12:13:20
阅读次数:
0
实验任务一: // 生成N个0~99之间的随机整数,并打印输出 #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int x, n; srand(time(0)); // 以当前系统时间 ...
分类:
其他好文 时间:
2021-04-14 12:11:43
阅读次数:
0
输入一个数,分解成其质因子 1 #include<stdio.h> 2 3 int main() 4 { 5 int val,temp; 6 scanf("%d", &val); 7 printf("%d=1*", val); 8 temp = val; 9 for (int i = 2; i < ...
分类:
其他好文 时间:
2021-04-14 11:57:55
阅读次数:
0
#题目 #代码 #include <unordered_map> #include <vector> using namespace std; class Solution { public: vector<int> twoSum(vector<int> &nums, int target) { v ...
分类:
其他好文 时间:
2021-04-13 12:55:20
阅读次数:
0
# cuda10.0 include_directories(/usr/local/cuda/include) link_directories(/usr/local/cuda/lib64) # tensorrt 7.0.0.11 set(TENSORRT_ROOT ${CMAKE_SOURCE_D ...
分类:
其他好文 时间:
2021-04-13 12:52:23
阅读次数:
0
// 生成N个0~99之间的随机整数,并打印输出 #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int x, n; srand(time(0)); // 以当前系统时间作为随机种子 ...
分类:
其他好文 时间:
2021-04-13 12:30:05
阅读次数:
0
函数题 /*练习5-1 求m到n之和 (10 分) 本题要求实现一个计算m~n(m<n)之间所有整数的和的简单函数。 函数接口定义: int sum( int m, int n ); 其中m和n是用户传入的参数,保证有m<n。函数返回的是m~n之间所有整数的和。 裁判测试程序样例: #include ...
分类:
编程语言 时间:
2021-04-13 12:28:09
阅读次数:
0
#include<stdio.h> int main() { int a=1; int b=1; if(a==b) { printf("相等"); } else { printf("不相等"); } return 0; } ...
分类:
编程语言 时间:
2021-04-13 12:15:37
阅读次数:
0
c语言入门教程–-6循环语句 c语言提供了以下几种循环类型。while循环for 循环do…while 循环 while循环 #include <stdio.h> int main () { /* 局部变量定义 */ int a = 10; /* while 循环执行 */ while( a < 2 ...
分类:
编程语言 时间:
2021-04-13 12:12:17
阅读次数:
0
我用c#编写了一款猜数字游戏,系统随机生成一个1到100之间的数字,玩家进行猜测,如果猜错,提示玩家数字过大或过小,如果猜对恭喜玩家胜利,并且推出游戏。 #include<iostream> using namespace std; int main() { int num = rand() % 1 ...
分类:
其他好文 时间:
2021-04-13 12:04:34
阅读次数:
0