Advertisement
chevengur

Подготовительный курс | Урок 11: Символы

Aug 14th, 2023 (edited)
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. /*
  2. Interesting:
  3. int main() {
  4.     char sym = 64;                     
  5.     cout << string(3, sym) + 'B';   //character concatenation
  6. }
  7. */
  8.  
  9.  
  10. #include <iostream>
  11. #include <string>
  12. #include <vector>
  13.  
  14. using namespace std;
  15.  
  16. int main() {
  17.     std::vector<char>ch;
  18.     for (int i = 0; i < 5; ++i) {
  19.         string word;
  20.         std::cin >> word;
  21.         ch.push_back(word[0]);
  22.     }
  23.  
  24.     for (const auto& l : ch) {
  25.         cout << l;
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement