欢迎使用CSDN-markdown编辑器
来源:互联网 发布:mysql qq充值 编辑:程序博客网 时间:2024/04/23 21:37
Learning C++ Programming Day 1:
Basic I/O
First day of learning C++, coded this little program to have a basic understanding of basic i/o and the new data types, e.g. the bool type.
第一天编写该小程序以基本了解基本输入输出,还有新数据类型bool。
Code:
Code for basic input and output:
#include <iostream> #include <stdlib.h>using namespace std;int main(void) { cout << "Please enter an integer:" << endl; int x = 0; cin >> x; cout << oct << x << endl; cout << dec << x << endl; cout << hex << x << endl; cout << "Please enter a boolean number(1 or 0):" << endl; bool y = false; cin >> y; cout << boolalpha << y << endl; system("pause"); return 0;}
Result:
Please enter an integer:
10
12
10
a
Please enter a boolean number(1 or 0):
1
true
请按任意键继续…
0 0
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- 欢迎使用CSDN-markdown编辑器
- hdu 4585- HDU 4585 Shaolin Treap + 寻找前驱后继 水
- ContentResolver query
- java枚举初解析
- Java线程Thread(三)
- 5. Longest Palindromic Substring--2016/09/27
- 欢迎使用CSDN-markdown编辑器
- 今日学习——素数及其优化
- 蜂鸣器的呐喊
- 专访左程云:5年刷题大牛分享算法学习之道
- 第一个OpenGL程序
- 数字组合
- 浅谈Java String内幕(2)
- 四旋翼飞行器结构和原理
- hexdump,od,xxd