Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string text;
- //текст с интервали -> getline
- //текст без интервали -> cin
- getline(cin, text);
- //"Desislava"
- //позициите на символите са от първата (0) до последната (lenght - 1)
- //начало: първата позиция -> 0
- //край: последната позиция -> дължина - 1
- //промяна: +1
- //повтаряме: отпечатваме символа на текущата позиция
- for (int position = 0; position < text.length(); position++)
- {
- cout << text[position] << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement