有一个字符数组的内容为:"student a am i", 请你将数组的内容改为"i am a student". 要求: 不能使用库函数。 只能开辟有限个空间(空间个数和字符串的长度无关)。 student a am i i ma a tneduts i am a student ...
分类:
编程语言 时间:
2019-02-14 00:31:13
阅读次数:
148
Math 一,Math.abs() 求绝对值 Math.PI 圆周率 二,求近似值: 1.Math.round() 四舍五入 负数: >0.5进1 <= 0.5舍去 2. Math.ceil() 向上取整 3.Math.floor() 向下取整 三,求最值 1.Math.max() 最大值。2,Ma ...
分类:
其他好文 时间:
2019-02-14 00:18:53
阅读次数:
144
输入一个整数,输出n*n矩阵 输出数字范围为1到n*n, 可以看做一个一个正方形边框放置而成,边框长度为n 每一个正方形框的长度为 n为偶数时 4+4*(n-2) n为奇数时 1+4*(n-2) 代码如下: #include<iostream> using namespace std; int ma ...
分类:
其他好文 时间:
2019-02-13 21:13:33
阅读次数:
170
1.Prim //手写prim 类似于dijkstra #include<iostream> #include<cstring> using namespace std; const int INF=0x7fffffff; const int maxn=100; int graph[maxn][ma ...
分类:
其他好文 时间:
2019-02-11 15:22:42
阅读次数:
199
淘宝的样式初始化代码: body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td { ma ...
分类:
其他好文 时间:
2019-02-11 13:03:46
阅读次数:
156
__author__ = "jocket2333"import sys# print(sys.argv)'''sys.argv 命令行参数List,第一个元素是程序本身路径sys.exit(n) 退出程序,正常退出时exit(0)sys.version 获取Python解释程序的版本信息sys.ma ...
分类:
编程语言 时间:
2019-02-09 15:12:48
阅读次数:
198
串的堆分配存储,其具体实现方式是采用动态数组存储字符串。 通常,编程语言会将程序占有的内存空间分成多个不同的区域,程序包含的数据会被分们别类并存储到对应的区域。拿C语言来说,程序会将内存分为4个区域,分别为堆区、栈区、数据区和代码区。其中的堆分配 与其他区域不同,堆区的内存空间需要程序员手动使用ma ...
分类:
其他好文 时间:
2019-02-04 23:22:38
阅读次数:
348
石子合并,入门区间dp 1 #include <cstdio> 2 #include <cstring> 3 #define maxn 305 4 #define min(a, b) a < b ? a : b 5 6 int n; 7 int sum[maxn]; 8 int f[maxn][ma ...
分类:
其他好文 时间:
2019-02-04 14:06:20
阅读次数:
173
1、Springboot项目引入mysql和mybatis的依赖: 2、在application.yml配置数据库连接信息,Mybatis信息,是否打印SQL等(具体看注释): 3、编写Mapper接口(普通接口,无需任何注解参与)统一放在com.example.demo.mapper包下,编写ma ...
分类:
编程语言 时间:
2019-02-01 01:16:37
阅读次数:
201
MapReduce框架原理 MapReduce核心思想 1)分布式的运算程序往往需要分成至少2个阶段。 2)第一个阶段的MapTask并发实例,完全并行运行,互不相干。 3)第二个阶段的ReduceTask并发实例互不相干,但是他们的数据依赖于上一个阶段的所有MapTask并发实例的输出。 4)Ma ...
分类:
移动开发 时间:
2019-01-29 20:52:52
阅读次数:
264