随笔分类 - c++
一路AC
摘要:#include <iostream> using namespace std; int main() { unsigned char uch = 233; char ch = (char)uch; unsigned char nuch = (unsigned char)ch; cout << (i
阅读全文
摘要:#include <iostream> #include <vector> // 点 class Node { public: int x; int y; }; // 保存每个块的左上角和右下角的坐标 class BlockData { public: Node lp; Node rp; }; //
阅读全文
摘要:因为有需求,需要程序在内存大小保存不变来保存数据,但是数据的取用又是按队列的来操作,节约时间节约内存,但是c++基础又不太好. #include <iostream> #include <string> using namespace std; typedef struct NN { string
阅读全文
摘要:unsigned int data1[4] = { 1,2,3,4 }; printf("%d\n", data1); int* data = (int*)data1; printf("%d\n", data);
阅读全文
摘要:#include <stdio.h> int main(int argc, char * argv[]) { // 参数的个数,包括自身的文件名 printf("%d\n", argc); int i = 0; while(i < argc) { printf("%s\n", argv[i++]);
阅读全文
摘要:一、加入头文件 include <map> 二、创建map变量 map<key, value> mp; 其中key、value为任意类型。而key是唯一的,value为key对应的值。 map用来计算一个字符串中各个字符出现的次数很方便,还可以计算单词出现的次数。 三、map的遍历 #include
阅读全文