摘要: 1 #include <iostream> 2 using namespace std; 3 4 #include <string.h> 5 6 7 8 int main() 9 {10 cout << typeid(3u).name() << endl;11 12 return 0;13 }打印unsigned intname返回的是char *类型 阅读全文
posted @ 2011-10-21 21:05 吃吃户 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 4 #include <string.h> 5 6 #define N 100 7 int matrix[N][N]; 8 int penalty = 10; 9 10 int MinOf3(int x, int y, int z) {11 x = x < y ? x : y;12 return x < z ? x : z;13 }14 15 int MinOf2(int x, int y)16 {17 return x < y ? x : y;18 }19 阅读全文
posted @ 2011-10-21 17:06 吃吃户 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 4 #include <stdlib.h> 5 #include <sys/types.h> 6 7 int Count(int * a, int n) 8 { 9 int count = 0;10 int candidate = a[0];11 while (n) {12 if (count == 0) {13 candidate = a[n-1];14 ++count;15 } else ... 阅读全文
posted @ 2011-10-21 15:23 吃吃户 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 0的个数 1 #include <iostream> 2 using namespace std; 3 4 #include <stdlib.h> 5 #include <sys/types.h> 6 7 int Count(int n) 8 { 9 int count = 0;10 while (n) { 11 count += n / 5;12 n /= 5;13 }14 return count;15 }16 17 int main()18 {19 cout << Count(26) << endl;20 ... 阅读全文
posted @ 2011-10-21 14:33 吃吃户 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 4 #include <stdlib.h> 5 #include <sys/types.h> 6 7 int Count(u_int32_t n) 8 { 9 int count = 0;10 while (n) { 11 ++count;12 n = n & (n - 1);13 }14 return count;15 }16 17 int main()18 {19 cout << Count(128) << end... 阅读全文
posted @ 2011-10-21 13:23 吃吃户 阅读(197) 评论(0) 推荐(0) 编辑
摘要: rpm -qa | grep sambanmbd -D 处理netbios名称服务,并提供网络浏览功能smbd -Dsamba服务的用户需要以某一个操作系统的用户访问。。。smbpasswd -a cch在使用Samba进行建立Window与Linux共享时,要是不能访问,出现“您可能没有权限使用网络资源”,那就是SELinux在作怪了要是想让共享目录能访问,可以使用命令#setenforce 0暂时停掉SELinux使用#setenforce 1启用SELinux费了我好大的力气才搞定的,放在这里分享,让大家少走一些弯路...早点解决问题...[myshare] security = ... 阅读全文
posted @ 2011-10-21 12:58 吃吃户 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 5 void Swap(int * a, int m, int n) 6 { 7 int temp = a[m]; 8 a[m] = a[n]; 9 a[n] = temp;10 }11 12 void Input(int *a, int n)13 {14 int i;15 for (i = 0; i < n; ++i) {16 a[i] = i;17 }18 }19 void Output(i... 阅读全文
posted @ 2011-10-08 23:24 吃吃户 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 5 #define NumOfElem(a) (sizeof(a)/sizeof(a[0])) 6 7 void Swap(int * a, int m, int n) 8 { 9 int temp = a[m];10 a[m] = a[n];11 a[n] = temp;12 }13 14 void Input(int *a, int n)15 {16 int i = 0;17 for (i = 0; i < n;... 阅读全文
posted @ 2011-10-08 22:13 吃吃户 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 1 #include <iostream> 2 using namespace std; 3 4 #define STR(s) #s // #的用法,转化为字符串 5 #define CONCAT(s1, s2) s1##s2 // ##连接后,作为变量名 6 7 #define MAX(a, b)\ 8 {if((a)>(b))\ 9 return (a);\10 else\11 return (b);\12 ... 阅读全文
posted @ 2011-10-08 12:59 吃吃户 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 头文件:get_config.h/***************************************************************************** 作者: jasitzhang(张涛)* 日期: 2011-10-2* 目的: 读取配置文件的信息,以map的形式存入* 要求: 配置文件的格式,以#作为行注释,配置的形式是key = value,中间可有空格,也可没有空格*****************************************************************************/#ifn... 阅读全文
posted @ 2011-10-02 12:36 吃吃户 阅读(30318) 评论(0) 推荐(4) 编辑