2017年5月15日

UDP网络通信程序

摘要: //服务器端 #include "Winsock2.h" #include "stdio.h" #pragma comment(lib, "ws2_32.lib") int main() { ////////////////////////////////////////加载套接字////////////////////////////////////////////////... 阅读全文

posted @ 2017-05-15 22:40 gechen 阅读(520) 评论(0) 推荐(0) 编辑

TCP网络程序设计

摘要: //服务端程序 #define _CRT_SECURE_NO_WARNINGS #include "winsock2.h" #include "stdio.h" #include "time.h" #pragma comment(lib,"WS2_32.lib") #define MAX_BUFFER 1024 /*服务器缓冲区的最大值为1024个字符*/ //#define NULL 0 #d... 阅读全文

posted @ 2017-05-15 16:34 gechen 阅读(120) 评论(0) 推荐(0) 编辑

2017年5月7日

LeetCode : Rotate Array

摘要: Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3... 阅读全文

posted @ 2017-05-07 00:34 gechen 阅读(80) 评论(0) 推荐(0) 编辑

LeetCode : Reverse Integer

摘要: Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321class Solution {public: int reverse(int x) { ... 阅读全文

posted @ 2017-05-07 00:31 gechen 阅读(68) 评论(0) 推荐(0) 编辑

LeetCode : First Bad Version

摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the ... 阅读全文

posted @ 2017-05-07 00:25 gechen 阅读(75) 评论(0) 推荐(0) 编辑

LeetCode:Excel Sheet Column Title

摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example:1 -> A2 -> B3 -> C...26 -> Z27 -> AA2... 阅读全文

posted @ 2017-05-07 00:17 gechen 阅读(82) 评论(0) 推荐(0) 编辑

2017年5月4日

LeetCode :Valid Palindrome

摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a c... 阅读全文

posted @ 2017-05-04 00:10 gechen 阅读(89) 评论(0) 推荐(0) 编辑

2017年5月3日

LeetCode :Count Primes

摘要: Description:Count the number of prime numbers less than a non-negative number, n.class Solution {public: int countPrimes(int n) { i... 阅读全文

posted @ 2017-05-03 14:26 gechen 阅读(61) 评论(0) 推荐(0) 编辑

2017年5月2日

LeetCode : Sqrt(x)

摘要: Implement int sqrt(int x).Compute and return the square root of x.class Solution {public: int mySqrt(int x) { long r = x; wh... 阅读全文

posted @ 2017-05-02 23:15 gechen 阅读(68) 评论(0) 推荐(0) 编辑

2017年5月1日

LeetCode : Third Maximum Number

摘要: Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time... 阅读全文

posted @ 2017-05-01 23:29 gechen 阅读(70) 评论(0) 推荐(0) 编辑

导航