-
类———用类定义对象———error:C++表达式必须包含
//原文参考https://blog.csdn.net/lanchunhui/article/details/52503332 你以为你定义了一个类的对象,其实在编译器看来你是声明了一个函数 1 class Test{ 2 public : 3 Test(){ } // 无参构造函数 4 void fool(){ } 5 }; 6 int main(){ 7 Test t(); // 编译器会将 t...
2019-05-22 06:26:46
-
树状数组
lowbit(x)=2^k int lowbit( int t) { return t (- t); } 单点更新 x是更改的位置,y是更改的值 void add( int x, int y) { for ( int i = x; i = n; i += lowbit(i)) tree[i] += y; } 求A数组中前x项的和 int getsum( int x) { int ans = 0 ; for ( int i = x; i 0 ; i...
2019-05-22 06:26:47
-
C++中的const分析
1,C 语言中的 const: 1,const 修饰的变量是只读的,本质还是变量; 1,C 语言中的 const 使变量具有只读属性; 2,const 只在编译期有用,在运行期无用; 3,const 修饰的局部变量在栈上分配空间; 1,可以有办法改变空间中的值,此时 const 修饰的值就改变了; 4,...
2019-05-22 06:26:45
-
读取CSV文件存入map中(C++)
自己平时操作文件用的不多,今天小伙伴让帮忙写一下这个,顺便记一下。实现功能:从"翻译.csv"文件中读取出字符串,以","作为分隔符,将每一行对应存入map中。 代码: #include iostream #include fstream #include string #include vector #include map using namespa...
2019-05-22 06:26:44
-
C++ 线性表实现
List.h #pragma once #include " targetver.h " #include stdio.h #include tchar.h #define LIST_INIT_SIZE 100 #define MAXSIZE 100 typedef int ElemType;typedef struct Sqlist { ElemType * elem; int length; int listsize;}Sqlist, * ListPtr;typedef enum Stat...
2019-05-22 06:26:44
-
codeforces 712A. Memory and Crow
2019-05-18 08:48:27 加油,加油,坚持!!! 这道题我没有想出公式推导,只是按照模拟题来做,第5个样例超时 样例超时,方法错误 https://www.cnblogs.com/ECJTUACM-873284962/p/6375011.html AC代码: #include bits/stdc++.h using namespace std;typedef long lon...
2019-05-18 07:07:16
-
read()和write(),读和写的优化。
读和写的优化在输入数据后输出数据十分多的情况下是十分有用的,比scanf和printf也要快。 读: int read(){ int x= 0 ; bool f= 0 ; char c= getchar(); while (c ' 0 ' c ' 9 ' ) f=!f,c= getchar(); while (c= ' 0 ' c= ' 9 ' ) x=x* 10 +c- ' 0 ' ,c= getchar(); re...
2019-05-18 07:07:09
-
HDU3783 ZOJ
2019-05-17 16:35:21 加油,加油,坚持,fightting #include bits/stdc++.h using namespace std; int main(){ string a; while (cin a) { int z = 0 ; int o = 0 ; int j = 0 ; if (a[ 0 ] == ' E ' ) { break ; } for ( int i = 0 ; i a.length(); i++ ) {...
2019-05-18 07:07:06
-
HUdson2092整数解
2019-05-17 16:04:37 加油,坚持就是胜利,fightting m / i的情况,i可能等于0 #include bits/stdc++.h using namespace std; int main(){ int n,m; while (~scanf( " %d %d " , n, m)) { if ( n == 0 m == 0 ) { break ; } int flat = 0 ; for ( int i =...
2019-05-18 07:07:04
-
HDU1412 {A} + {B}
2019-05-17 10:15:01 每个元素之间有一个空格隔开. 每行最后一的元素后面没有空格,区别于HDU人见人爱A - B 注意使用STL的时候要清空 。 a.clear(); #include bits/stdc++.h using namespace std; set int a; int b[ 100000 ]; int main(){ int n, m; int i, j; while...
2019-05-18 07:07:01
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash