自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 资源 (3)
  • 收藏
  • 关注

原创 编写基于gRPC的C/S通信模型

1、编写.proto文件包含:1)定义service,用service{}包起来service ServiceName{ rpc funcname1(Request) returns (Reponse){} rpc funcname2(Request) returns (Reponse){}}2)message Request{}3)message Response{}2、...

2018-06-22 20:13:28 905

原创 web-app开发——简单的HTTP服务器

go本身可以直接实现HTTP服务器,而不依赖于nginx、Apache等服务器,直接使用包net/http中的函数即可实现,代码如下:package mainimport ( "fmt" "log" "net/http")func helloWorld(w http.ResponseWriter, r *http.Request) { r.ParseForm() //解析参数,默...

2018-06-19 14:51:05 954

原创 Go语言——struct、type、func的综合用法

最近在学golang语言,对于struct、type、func的学习进行了简单的编程练习,代码如下package mainimport ( "fmt")const ( WHITE = iota BLACK BLUE RED YELLOW)//Color 声明Color为byte的别名type Color byte //Box type boxtype Box s...

2018-06-15 19:48:08 10119

原创 Set Matrix Zeroes

需求:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place.Example 1:Input: [  [1,1,1],  [1,0,1],  [1,1,1]]Output: [  [1,0,1],  [0,0,0],  [1,0,1]]分析:1、...

2018-06-08 10:15:02 170

原创 jump games I/II

需求I:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if yo...

2018-06-07 17:13:27 161

原创 Spiral Matrix I/II

需求:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.Example 1:Input:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]Output: [1,2,3,6,9,8,7,4,5]分析:...

2018-06-07 14:26:07 159

原创 N-Queens I/II

需求:n皇后问题,有一个n*n的棋盘,有n个皇后,要保证每个皇后不能在同一行、同一列、同一对角线,这样才不会出现冲突,求解n皇后共有多少种放置方式。分析:1、创建n*n的char型二维数组,初始化为'.',表示没有放置皇后。2、因为皇后不能在同一行,所以将皇后i放到行i,逐行确定每个皇后的位置。假设,现在要确定皇后num(num的范围是0~n-1)的位置,如果num==n,那么说明已经找到了一个可...

2018-06-07 10:30:27 459

java大数相减代码

java实现大数相减,在不使用BigInteger工具的前提下实现大数相减

2017-11-29

java大数相加代码

java实现大数相加,在不使用BigInteger工具的前提下实现大数相加

2017-11-29

java大数相乘代码

java实现大数相乘,在不使用BigInteger工具方法的前提下进行大数相乘运算。

2017-11-29

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除