零起点学C++ 第四章 C++数据结构
2016-07-08 17:35
309 查看
demo1:变量的定义
#include <iostream>
int add(int x,int y)
{
return x+y;
}
using namespace std;
int main()
{
int x=1,y=2;
cout<<add(x,y);
return 0;
}
demo2:将变量及数据存储在内存中
#include <iostream>
using namespace std;
int main()
{
int a=35;
cin>>a;
return 0;
}
demo3:布尔型变量
#include <iostream>
using namespace std;
int main()
{
bool check=true;
if (check==true)
{
cout<<"hello world\n";
}
return 0;
}
demo4:字符型比变量
#include <iostream>
using namespace std;
int main()
{
cout<<"特殊字符";
char ch='\r';
cout<<ch<<"特殊用途";
return 0;
}
#include <iostream>
int add(int x,int y)
{
return x+y;
}
using namespace std;
int main()
{
int x=1,y=2;
cout<<add(x,y);
return 0;
}
demo2:将变量及数据存储在内存中
#include <iostream>
using namespace std;
int main()
{
int a=35;
cin>>a;
return 0;
}
demo3:布尔型变量
#include <iostream>
using namespace std;
int main()
{
bool check=true;
if (check==true)
{
cout<<"hello world\n";
}
return 0;
}
demo4:字符型比变量
#include <iostream>
using namespace std;
int main()
{
cout<<"特殊字符";
char ch='\r';
cout<<ch<<"特殊用途";
return 0;
}
相关文章推荐
- poj2479
- 二叉树基础及应用
- poj 2481 cows 树状数组
- 数据结构复习练手之nyoj5
- 数据结构与算法简记:通过前序中序或中序后序构建二叉树
- 数据结构-AVL树
- 二叉树基础-由中根序列和后根序列重建二叉树(数据结构基础 第5周)
- 树的定义和基本概念
- 反转单链表
- 关于数据结构之树的一些总结
- 浅析Python heapq模块 堆数据结构
- Java数据结构与算法学习记录(1)
- 单链表(带或不带头结点)的建立、反转和部分反转
- 【数据结构】二叉搜索树
- 二叉树基础-二叉树类模板的实现(数据结构基础 第5周)
- 算法导论 第三部分——基本数据结构——栈、队列、链表、散列表
- 数据结构与算法概述
- 数据结构课程设计之哈夫曼编码模块
- 查询json数据结构的方法
- 数据结构之超级简单的红黑树