44 C++ Primer Plus(第六版)第三章 编程练习答案 1 2 3 4 5 6 7 1 #include<iostream> #include <stdlib.h> #include<string> using namespace std; int main() { const int transf = 12; int a; cout << "请输入身高(英寸):___\b\b\b"; cin >> a; int foot = a / transf; int inch = a % transf; cout << "身高为" << foot << "英尺" << inch << "英寸" << endl; system("pause"); return 0; } 2 #include<iostream> #include <stdlib.h> #include<string> using namespace std; int main() { const double transf1 = 12; const double transf2 = 0.0254; const double transf3 = 2.2; int a,b,c; cout << "请输入身高(英尺):___\b\b\b"; cin >> a; cout << "请输入身高(英寸):___\b\b\b"; cin >> b; cout << "请输入体重(磅):___\b\b\b"; cin >> c;