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
John never knew he had a grand-uncle, until he received the notary's letter. He learned that his late grand-uncle had gathered a lot of money, somewhe...
分类:
其他好文 时间:
2014-07-22 00:26:36
阅读次数:
281
日期: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
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
写出以下shell脚本1 判定一个用参数指定的文件是否为可执行,如果不是,则改为可执行#!/bin/bash if [ -x $1 ]then echo "OK"else echo "chmod a+x"chmod a+x $1fi 2 用while和until循环,实现输出某年前9个月月历的效果 ...
分类:
其他好文 时间:
2014-07-21 08:19:28
阅读次数:
279
有一个函数如下: 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
Wormholes
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 30169
Accepted: 10914
Description
While exploring his many farms, Farmer John has discovered a nu...
分类:
其他好文 时间:
2014-07-20 23:03:06
阅读次数:
301