CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <iostream>
using namespace std;
int main() {
string typed_word;
getline(cin, typed_word);
//makes the user type in a word and stores the typed word in a variable
int word_length;
word_length = size(typed_word);
//measures and stores the length of the word in letters in a variable
cout << "Word you typed: ";
cout << typed_word <<endl;
//outputs the word that was inputted
cout << " " <<endl;
cout << "Length of the word: ";
cout << word_length <<endl;
//outputs the length of the word in letters
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Запуск