瘋子C++笔记1.C++输入、输出、头文件解释#includeusing namespace std ;int mian(){ cout >"输入流对象。如(int a,b; cin >> a >> b;第一个输入赋给a,第二个输入赋给b)(6)cout using namespace std .....
分类:
编程语言 时间:
2014-09-16 14:09:40
阅读次数:
175
瘋子C++笔记1.C++输入、输出、头文件解释#includeusing namespace std ;int mian(){ cout >"输入流对象。如(int a,b; cin >> a >> b;第一个输入赋给a,第二个输入赋给b)(6)cout using namespace std .....
分类:
编程语言 时间:
2014-09-16 14:07:40
阅读次数:
200
1、使用gcc编译c++文件报错proc1.cc:(.text+0x14):undefinedreferenceto`std::cout'C++程序使用gcc命令只能编译,不能链接库文件应该使用g++编译2、运行一个程序之后可以使用echo$? 返回该程序返回值(main函数的返回值必须是一个int...
分类:
编程语言 时间:
2014-09-16 12:16:40
阅读次数:
296
求两个数a和b的最大公约数,可以想到的是从[1,min(a,b)]枚举每个正整数:#includeusing namespace std;int gcd(int a,int b){ int ans=1; for(int i=2;i>a>>b; cout=b)证明:设gcd(a,b)...
分类:
其他好文 时间:
2014-09-16 10:41:00
阅读次数:
188
1 // you can use includes, for example: 2 // #include 3 4 // you can write to stdout for debugging purposes, e.g. 5 // cout &A) { 8 // write y...
分类:
其他好文 时间:
2014-09-15 22:39:49
阅读次数:
212
原文地址:
#include
#include
#include
#include
using std::cout;
using std::endl;
using std::string;
using std::stack;
int arr1[10] = {3,5,2,8,6,1,4,0,9,7};
int arr2[10] = {3,5,2,8,6,1,4,0,9,7};
v...
分类:
其他好文 时间:
2014-09-14 23:44:47
阅读次数:
193
#include using namespace std;class a{ public: a(){ value ++; cout using namespace std;class a{ public: a(){ ...
分类:
其他好文 时间:
2014-09-14 01:18:06
阅读次数:
267
当我们的程序在运行时才能决定数组空间的大小的情况下,我们会经常使用new或者malloc来在堆空间中动态的申请一片空间,这是相当的方便和实用的。最近经常使用自己也发现了一些问题以及自己对这些问题的思考:
void main()
{
int *B;
cout<<*B;
fun(&B);
cout<<*B;
}
void fun(int **A)
{
*A=new int(10);
}上面...
分类:
其他好文 时间:
2014-09-13 15:57:05
阅读次数:
210
悬垂指针:1:提出的原因:请看下面的代码片段:[cpp]view plaincopyprint?int*p=NULL;voidmain(){inti=10;p=&i;cout#include#include#includeusingnamespacestd;intmain(void){char*p=...
分类:
其他好文 时间:
2014-09-13 10:31:05
阅读次数:
229
#include
using namepspace std;
int main()
{ cout<<"Hello World"<<endl;
}
分类:
其他好文 时间:
2014-09-13 04:07:34
阅读次数:
213