C++学习札记一

来源:互联网 发布:java工程师是什么意思 编辑:程序博客网 时间:2024/05/20 00:13

这里写图片描述主要是根据C++来说 发现\b退格的用处 以及const的应用 写博客有点累啊

// bondini.cpp -- using escape sequences#include <iostream>int main(){    using namespace std;      cout.setf(ios_base::fixed, ios_base::floatfield);//fixed-point    cout << "Please enter your height in inches: ___\b\b\b ";//这个体现的就是退格的思想    int inch; double infeet;    cin >> inch;    const int convert = 12;    infeet = (double)inch / convert;    cout << "This person height is " << inch << endl        << infeet << endl;    return 0;}

运行结果这就是结果的不同 主要是退格![](http://img.blog.csdn.net/20160203102551732)

对比一下

1 0