您的位置:首页 > 编程语言 > C语言/C++

3.1

2015-10-27 16:46 197 查看
学习《c++ primer plus第六版》也有一段时间了,今天开始把课后写的代码传到博客上来,也算是开始写博客了吧。

#include<iostream>

int main()
{
using namespace std;

const double transition = 12;
double inch_height;
double foot_height;
int t_inch_height;

cout << "Please enter your height(inch),and this program will transform it to foot and inch : _____.\b\b\b\b\b\b" ;
cin >> inch_height;
t_inch_height = int(inch_height)*transition;
foot_height = (inch_height - int(inch_height))*transition;
cout << "Your height is " << t_inch_height << " inches and " << foot_height << " feet\n";

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c++