摘要: #includeusing namespace std;int reverse(int n){ return ((n & 0x55555555) > 1);}int main(){ int n; cin >> n; int res=reverse(n); co... 阅读全文
posted @ 2017-03-14 22:35 乐天的java 阅读(86) 评论(0) 推荐(0)
摘要: #includeusing namespace std;int main(){ int m = 5; if (m++ > 5) { cout using namespace std;int main(int args,char **argv){ if (!(... 阅读全文
posted @ 2017-03-14 21:23 乐天的java 阅读(50) 评论(0) 推荐(0)
摘要: #includeusing namespace std;int main(){ char c; int i = 0; bool flag = true; while ((c = getchar()) != EOF) { if (flag) { cout... 阅读全文
posted @ 2017-03-14 21:21 乐天的java 阅读(46) 评论(0) 推荐(0)
摘要: #includeusing namespace std;static int i = 0;class Widget{public: Widget() { //cout << i++ << endl; } Widget(Widget &w) { (*this... 阅读全文
posted @ 2017-03-14 21:19 乐天的java 阅读(28) 评论(0) 推荐(0)
摘要: #includeusing namespace std;int main(){ char c; int count = 0; while ((c = getchar()) != EOF) { if ('{' == c) { count++; } e... 阅读全文
posted @ 2017-03-14 21:17 乐天的java 阅读(44) 评论(0) 推荐(0)
摘要: 易错题 #include using namespace std; class A { public: int _a; int b; A() { b = 4;//若是不同名则不屏蔽也不需要通过::访问 _a = 1; } void prin... 阅读全文
posted @ 2017-03-14 21:11 乐天的java 阅读(48) 评论(0) 推荐(0)
摘要: (1)#include (2)#include"头文件名称" 第一种形式一般用来包含开发环境提供的库头文件,它指示编译预处理器 在开发环境中设定的路径中找所需的头文件。 第二种形式一般用来包含自己写的头文件,它指示编译预处理器在当前工 作目录中搜索头文件,如果... 阅读全文
posted @ 2017-03-13 22:17 乐天的java 阅读(82) 评论(0) 推荐(0)
摘要: C结构体之位域(位段) 有些信息在存储时,并不需要占用一个完整的字节, 而只需占几个或一个二进制位。例如在存放一个开关量时,只有0和1 两种状态, 用一位二进位即可。为了节省存储空间,并使处理简便,C语言又提供了一种数据结构,称为“... 阅读全文
posted @ 2017-03-13 21:19 乐天的java 阅读(89) 评论(0) 推荐(0)
摘要: struct关键字 空结构体有多大? struct student{}stu;coutusing namespace std;typedef struct st_type{ int i; int a[0];}type_a;int ma... 阅读全文
posted @ 2017-03-13 20:27 乐天的java 阅读(179) 评论(0) 推荐(0)
摘要: 1、数组名的本质 数组名的本质相当于一个常量指针 如:int a[10] aint *const a; int b[10][20... 阅读全文
posted @ 2017-03-13 19:11 乐天的java 阅读(50) 评论(0) 推荐(0)