#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
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
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()#include<iostream>
#include<string>
#include<algorithm>
usingnamespacestd;
intmain()
{
stringletters;
cout<<"Enterthelettersgrouping(quittoquit):";
while(cin>>letters&&letter..
分类:
其他好文 时间:
2014-08-29 03:03:17
阅读次数:
242
题目: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
迭代器中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
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
过程记录4个月前C语言版的七大排序算法实践让我在写C++版时轻车熟路。特别是冒泡,插入,希尔,选择这四种排序不用调试即运行成功。输出的效果与C语言做的版本完全一样,其中令我印象深刻的是,cout对浮点的处理远不如printf简单明了。非常让开发者难受。写C++版时有所改进。#define sortf...
分类:
其他好文 时间:
2014-08-28 12:55:29
阅读次数:
250
??
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