lesson_60

This commit is contained in:
Alexander Zhirov 2021-09-11 13:47:34 +03:00
parent e280a4648d
commit 041b78ee42
1 changed files with 31 additions and 0 deletions

31
lesson_60/main.cpp Normal file
View File

@ -0,0 +1,31 @@
/*
* main.cpp
*
* Created on: 11 сент. 2021 г.
* Author: alexander
*/
#include <iostream>
#include <string>
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<float>(age) / name.length()
<< " years for each letter in your name." << endl;
return 0;
}