fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string st="Hello, world!", s, t;
  7. cout<<st<<endl;
  8.  
  9. cout<< "Вывод строки через пробел: " ;
  10. for (int i=0; i<st.length(); i++)
  11. cout<<st[i]<<" ";
  12. cout<<endl;
  13. return 0;
  14. }
Success #stdin #stdout 0s 4808KB
stdin
13
stdout
Hello, world!
Вывод строки через пробел: H e l l o ,   w o r l d !