摘要: 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) 编辑