using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace C_编辑基础{ //枚举的意义就是限定变量的取值范围 enum gender{Male,Female,...
分类:
其他好文 时间:
2014-07-22 00:32:36
阅读次数:
172
冒泡排序代码:
#include
#include
using namespace std;
template
void bubbleSort(ItemType theArray[], int n)
{
bool sorted = false; // False when swaps occur
int pass = 1;
while (!sorted && (pass...
分类:
其他好文 时间:
2014-07-22 00:32:35
阅读次数:
363
日期:2014年7月21日一、控制结构1、Go中,只有几个控制结构,它没有do或者while循环,有for,灵活的switch语句和if,在switch中可以接受像for那样可选的初始化语句,另外Go中还提供了类型选择和多路通信转接器的select。Go的控制结构的语法和C相比有所不同,它不需要圆括...
分类:
其他好文 时间:
2014-07-22 00:26:35
阅读次数:
248
从socket中读取数据可以使用如下的代码: while( (n = read(socketfd, buf, BUFSIZE) ) >0) if( write(STDOUT_FILENO, buf, n) = n) { printf(“write error”); exit(1); }当代码中的so...
分类:
其他好文 时间:
2014-07-22 00:26:33
阅读次数:
267
自定义类加载器是在是血的不怎明白这里只学会了一个简单的加密解密方法//定义一个加密方法public static void md(InputStream inputStream,OutputStream outputStream) throws Exception{int b = 0;while((...
分类:
其他好文 时间:
2014-07-22 00:21:33
阅读次数:
196
本节,我们将对leetcode上有关DP问题的题目做一个汇总和分析。
1.题目来源
Interleaving String
动态规划 二叉树
Unique Binary Search Trees 动态规划
二叉树
Word Break 动态规划
N/A
Word Break II 动态规划
N/A
Palindrome Partitioning 动态规划
N/A
...
分类:
其他好文 时间:
2014-07-21 15:47:05
阅读次数:
232
本节,我们将对leetcode上有关DP问题的题目做一个汇总和分析。
1.题目来源
Interleaving String
动态规划 二叉树
Unique Binary Search Trees 动态规划
二叉树
Word Break 动态规划
N/A
Word Break II 动态规划
N/A
Palindrome Partitioning 动态规划
N/A
...
分类:
其他好文 时间:
2014-07-21 15:21:05
阅读次数:
189
import Foundation
println("Hello, World!")
/*
for do While While Switch
*/
var arr = [1,2,3,4,5,7];
for i in arr{
println(" i is \(i)");
}
var count = arr.count;
for (var i = 0 ; i<count; ...
分类:
其他好文 时间:
2014-07-21 13:23:47
阅读次数:
190
有一个函数如下: 1 public static void SortNum(int numA, int numB) 2 { 3 int x = 0; 4 int y = 0; 5 while (num...
分类:
其他好文 时间:
2014-07-21 08:14:45
阅读次数:
726
6,给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字。
//intnum=0,temp=0,i=0;
//printf("输入一位数字:");
//scanf("%d",&num);
//while(num>0){
//temp=num%10;
//printf("%d",temp);
//i++;
//num=num/10;
//}
//printf("\n%d位数",i);
分类:
编程语言 时间:
2014-07-21 07:21:35
阅读次数:
252