
知识点
小米的蝉
Keep It Simple and Stupid
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
istringstream、ostringstream、stringstream 类介绍 .
见以下链接 istringstream、ostringstream、stringstream 类介绍 .0、C++的输入输出分为三种:(1)基于控制台的I/O#include<iostream>(2)基于文件的I/O#include<fstream>(3)基于字符串的I/O#include<sstream>str():使istringstream对象返回一个string字符串stringstrea原创 2017-11-18 17:23:05 · 165 阅读 · 0 评论 -
关于 1.0/0.0 以及 0.0/0.0 的值
#include<cstdio> #include<iostream> using namespace std; int main() { printf("%d\n",1.0/0.0);//0 printf("%d\n",0.0/0.0);//0 printf("%lld\n",1.0/0.0);//9218868437227405312 printf("%lld\n原创 2017-11-20 21:55:39 · 1475 阅读 · 0 评论 -
比赛中使用文件输入输出
使用文件最简单的方式就是使用输入输出重定向freopen("input.txt","r",stdin);//从文件读入 freopen("outout.txt","w",stdout);//写入文件非重定向#include<stdio.h> int main() { FILE *fin,*fout; int x; fin = fopen("input.txt","rb");/原创 2017-11-20 22:09:52 · 321 阅读 · 0 评论 -
判断字符是否为字母或数字
参考: C语言中isalnum()函数和isalpha()函数的对比使用 C语言 判断字符的大小写 isalpha()函数#include<ctype.h>//或<cctype> int isalpha(int ch)//为英文字母时返回不一定为1的非零,否则返回零 isalnum(c)//判断c是否为英文字母或数字 isupper(c)//判断c是否为大写英文字母 islower(c)//判转载 2017-11-23 21:56:47 · 1653 阅读 · 0 评论 -
cin、cin.get()、cin.getline()、getline()、gets()等函数的用法
参考于cin、cin.get()、cin.getline()、getline()、gets()等函数的用法 cin>> (1) >> 是会过滤掉不可见字符(如 空格 回车,TAB 等) cin.get() (1) cin.get(char);//接受一个字符 (2) cin.get(char*,接收字符数目);//可以接收空格,接收数目=实际接收字符+1个’\0’ cin.getline()原创 2017-12-14 20:41:21 · 354 阅读 · 0 评论 -
DFS的递归实现
对一个例子的理解,以下是关系图的关系矩阵,求从1开始能到哪个数#include<iostream> #include<queue> # e<cstdio> #include<vector> #include<stack> using namespace std; int const N =5; int maze[N][N]={ {0,1,1,0,0}, {0,0,1,0,1},原创 2017-12-07 21:49:41 · 1502 阅读 · 0 评论 -
关于辗转相除
#include<iostream> using namespace std; int gcd(int a,int b,int& x,int &y){ if(b==0){ x = 1; y = 0; return a; } int q = gcd(b, a%b, y, x); // y 是...原创 2019-03-03 22:44:10 · 260 阅读 · 0 评论 -
背包问题 01 和完全
#include<iostream> using namespace std; int w[] = {0,2,3,4,7}; int v[] = {0,1,3,5,9}; const int Cap = 10; int m[Cap+1][Cap+1] = {0}; int N = 4; void show(); int pack01(){ //https://www.cnblogs.c...原创 2019-03-04 17:46:33 · 283 阅读 · 0 评论