From 041b78ee425cf481a30a508b14ffc2b975c41b92 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Sat, 11 Sep 2021 13:47:34 +0300 Subject: [PATCH] lesson_60 --- lesson_60/main.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lesson_60/main.cpp diff --git a/lesson_60/main.cpp b/lesson_60/main.cpp new file mode 100644 index 0000000..8ec00fe --- /dev/null +++ b/lesson_60/main.cpp @@ -0,0 +1,31 @@ +/* + * main.cpp + * + * Created on: 11 сент. 2021 г. + * Author: alexander + */ +#include +#include + +int main() +{ + using std::string; + using std::cout; + using std::cin; + using std::endl; + using std::getline; + + cout << "Enter your full name: "; + string name; + getline(cin, name); + cout << "Enter your age: "; + int age; + cin >> age; + cout << "You've lived " << static_cast(age) / name.length() + << " years for each letter in your name." << endl; + + return 0; +} + + +