03 2020 档案
摘要:转:https://www.runoob.com/cplusplus/cpp-class-access-modifiers.html
阅读全文
摘要:逻辑运算符 && 逻辑与(乘法) || 逻辑或(加法) !逻辑非(取反) 位运算符 & 与 | 或 ~ 非 ^ 异或(相同为0,相异为1) << 左移(左移n位,就是原数乘以2的n次方——十进制) >> 右移(右移n位,就是原数除以2的n次方——十进制)
阅读全文
摘要:存储类定义 C++ 程序中 变量/函数 的 范围(可见性)和 生命周期。这些说明符放置在它们所修饰的类型之前。下面列出 C++ 程序中可用的存储类: auto :声明变量并初始化时,根据右值来确定左值的类型 register :声明的变量存储在寄存器上,而不是内存上,不能使用“&”运算符(因为它没有
阅读全文
摘要:desc 表名;show columns from 表名;describe 表名;show create table 表名;
阅读全文
摘要:1 #include<cstdio> 2 #include<cstring> 3 const int N = 10; 4 int a[N][N]; 5 int main(){ 6 int n,x,y,tot; 7 memset(a,0,sizeof(a)); 8 scanf("%d",&n);//n
阅读全文
摘要:1 #include<iostream> 2 using std::cout; 3 4 5 int func(char *s){ 6 if(s==NULL) return -1; 7 8 int num=0; 9 while(*s!='\0'){ 10 num = num*10 + *s - '0'
阅读全文
摘要:1 #include <iostream> 2 3 int main(){ 4 5 char c1 = 'a'; 6 char c2 = 'b'; 7 8 const char *p = &c1; 9 // *p = 'b';//错 10 p = &c2;//对 11 // 结论:const cha
阅读全文
摘要:1 #include <iostream> 2 using namespace std; 3 4 typedef int elem; 5 6 struct Node{ 7 elem n; 8 struct Node * next; 9 }; 10 11 //创建 12 Node* Create_li
阅读全文
摘要:题意: 比如,输入:I come from China. 输出:China. from come I 思路:先将这个字符串整体倒置,再将单个单词倒置,这样既不需要移动元素,也不需要额外的辅助空间,还可以重用代码,很不错吧。 代码: 1 #include <iostream> 2 3 int len(
阅读全文
浙公网安备 33010602011771号