1. 程式人生 > >C++ Primer Plus第六版編程練習---第3章 處理數據(未完待續)

C++ Primer Plus第六版編程練習---第3章 處理數據(未完待續)

foo ons enter ++ har HA CI return include

1.

#include <iostream>

const int CONVER_FACTOR = 12;

int main(int argc, char* argv[])
{
int height = 0;
std::cout << "Pleas enter your height with inch_ ";
std::cin >> height;
if(0 > height)
{
std::cout << "Pleas enter your height with inch_ ";
std::cin >> height;
}
std::cout << "You are " << height/CONVER_FACTOR << " foots and " << height%CONVER_FACTOR << " inches." << std::endl;
return 0;

}

C++ Primer Plus第六版編程練習---第3章 處理數據(未完待續)