码迷,mamicode.com
首页 >  
搜索关键字:cout    ( 7219个结果
自动识别当前语言系统
#include #include using namespace std; int main() { unsigned short cid = GetSystemDefaultLCID(); switch (cid){ case 0x0804: cout << "简体中文" << endl; break; case 0x0404: cout << "繁体系统" << en...
分类:其他好文   时间:2014-08-29 14:44:28    阅读次数:155
C++子类中显式调用基类函数
1 #include 2 using namespace std; 3 4 class thebase { 5 public: 6 virtual void basePrint() { 7 cout << "the base class basePrint(...
分类:编程语言   时间:2014-08-29 12:41:00    阅读次数:453
数据结构常用算法
//汉诺塔 void Hanoi(int n,string A,string B,string C){ if(n == 1) cout"<<C<<endl; else{ Hanoi(n-1,A,C,B); cout"<<C<<endl; Hanoi(n-1,B,A,C); } } //递归实现 int maxNUm(int num[],int n){ if(1 ==...
分类:其他好文   时间:2014-08-29 11:03:07    阅读次数:174
cout如何输出十六进制
http://blog.csdn.net/okadler0518/article/details/4962340coutusingnamespacestd;intmain(void){chardata[8]={0x68,0x04,0x43,0x00,0x00,0x00};for(inti=0;i<8...
分类:其他好文   时间:2014-08-29 10:33:27    阅读次数:213
STL中简单算法实例sort()、next_permutation()
STL中简单算法实例sort()、next_permutation()#include<iostream> #include<string> #include<algorithm> usingnamespacestd; intmain() { stringletters; cout<<"Enterthelettersgrouping(quittoquit):"; while(cin>>letters&&letter..
分类:其他好文   时间:2014-08-29 03:03:17    阅读次数:242
ZOJ 3625 Geek's Collection (数学公式,注意long double输出格式,附输出格式总结)
题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3625题意:注意:1、欧拉常数为$euler=0.57721566490153286060651209$2、用long double3、输出方法:两种cout setpr...
分类:其他好文   时间:2014-08-28 22:23:46    阅读次数:468
iterator-迭代器
迭代器中copy()andinsertiterators//inserts.cppcopy()andinsertiterators #include<iostream> #include<string> #include<iterator> #include<vector> #include<algorithm> usingnamespacestd; voidoutput(conststring&s) { cout<<s..
分类:其他好文   时间:2014-08-28 18:18:06    阅读次数:199
【C++ Primer每日一刷之七】指针操作
4.2.3 指针操作   指针提供间接操纵其所指对象的功能。与对迭代器进行解引用操作一样,对指针进行解引用可访问它所指的对象,* 操作符(解引用操作符)将获取指针所指的对象:   string s("hello world"); string *sp = &s; // sp holds theaddress of s cout   对 sp 进行解引用将获得 s 的值,然后用输出...
分类:编程语言   时间:2014-08-28 18:10:45    阅读次数:349
【实习记】2014-08-27堆排序理解总结+使用typedef指代函数指针
过程记录4个月前C语言版的七大排序算法实践让我在写C++版时轻车熟路。特别是冒泡,插入,希尔,选择这四种排序不用调试即运行成功。输出的效果与C语言做的版本完全一样,其中令我印象深刻的是,cout对浮点的处理远不如printf简单明了。非常让开发者难受。写C++版时有所改进。#define sortf...
分类:其他好文   时间:2014-08-28 12:55:29    阅读次数:250
文件重定向,getline()获取一样,屏幕输出流,格式控制符dec,oct,hex,精度控制setprecision(int num),设置填充,cout.width和file(字符),进制输入
?? 1.在window下的命令重定向输出到文件中 2.将内容输入到某个文件中的方式:命令<1.txt (使用1.txt中的命令) 3.读取文件中的名,然后将命令读取最后输出到文件中。命令2.txt   这一句的作用就是将执行的命令输入到2.txt中。 4.文件重定向案例1 #include using namespace std;   ...
分类:其他好文   时间:2014-08-28 00:58:08    阅读次数:543
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!