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;
}
原文地址:https://www.cnblogs.com/f00345709/p/8955760.html
时间: 2024-10-09 23:49:51