unsigned int Gcd (unsigned int m,unsigned int n){ unsigned int rem; while(n>0){ rem = m % n; m = n; n = rem; } return...
分类:
其他好文 时间:
2014-07-16 23:18:24
阅读次数:
497
1.个位数统计:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
char s[1005];
int n, a[10];
int main(){
while(gets(s)) {
memset(a,...
分类:
其他好文 时间:
2014-06-28 08:55:24
阅读次数:
191
(一)
下面这段代码:
int x;
void someFunc()
{
double x; //local variable
std::cin>>x; //read a new value to local x
}
这个指涉的是local变量x,而不是global变量x,因为内存作用域会的名称遮掩外围作用域的名称。当编译器处于someFunc的作用域内并遭遇...
分类:
编程语言 时间:
2014-06-28 07:58:25
阅读次数:
281
1、mem_init() : 内存堆初始化函数,主要设置内存堆的起始地址,以及初始化空闲列表,lwip初始化时调用,内部接口。
2、void *mem_malloc(mem_size_t size) : 申请分配内存,size为需要申请的内存字节数,返回值为最新分配的内存块的数据地址,注意
不是内存块的地址。如果为分配好内存,返回NULL。申请的内存堆是全局变量。...
分类:
其他好文 时间:
2014-06-28 07:12:32
阅读次数:
280
一.修改Linux主机名1.hostname主机名[root@nsnamed]#hostnameifs.com2.vi/etc/hosts[root@nsnamed]#vi/etc/hosts
127.0.0.1ns.ifs.com
::1localhostlocalhost.localdomainlocalhost6localhost6.localdomain6
~3.vim/etc/sysconfig/network[root@nsnamed]#vi/etc/sysconfig/netw..
分类:
系统相关 时间:
2014-06-28 06:18:40
阅读次数:
442
在需要的连接添加行内样式:
<ahref="ddrb/090630.asp"target="_blank"style="text-decoration:underline;">30</a>CSStext-decoration属性可能的值值描述none默认。定义标准的文本。underline定义文本下的一条线。overline定义文本上的一条线。line-through定义穿..
分类:
Web程序 时间:
2014-06-28 00:33:36
阅读次数:
247
遍历目录中所有文件,并且统计文件类型。#!/bin/bash
#filename:filestat.sh
#set-x
if[$#-ne1];
then
echo$0basepath;
echo
fi
path=$1
declare-Astatarray;
whilereadline;
do
ftype=`file-b"$line"`
letstatarray["$ftype"]++;
done<<(find$path-typef-print)
ech..
分类:
其他好文 时间:
2014-06-28 00:16:08
阅读次数:
224
学习了scala的基本知识后,发现了scala是集函数式和指令式结合为一体的一种语言,代码更加简洁,但是对于用习惯了java的人来说,还真的不是一件易事~~今天学习scala脚本读取文本文件列子如下:importscala.io.Sourceif(args.length>0){for(line<-Source.fromFile(args(0)..
分类:
其他好文 时间:
2014-06-28 00:09:26
阅读次数:
281
Iterative ways: 1 int binarySearch (int[] a, int x) { 2 int low = 0; 3 int high = a.length - 1; 4 int mid; 5 6 while (low x) {12 ...
分类:
其他好文 时间:
2014-06-27 22:27:06
阅读次数:
361