fork(1) download
  1. #include<iostream>
  2. #include<string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string s1, s2;
  9.  
  10. cin >> s1 >> s2;
  11.  
  12. string s1 = "Alice";
  13. string s2 = "Bob";
  14.  
  15. cout << s1 << ' ' << s2 << '\n';
  16.  
  17. return 0;
  18.  
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:9: error: redeclaration of ‘std::__cxx11::string s1’
  string s1 = "Alice";
         ^~
prog.cpp:8:9: note: ‘std::__cxx11::string s1’ previously declared here
  string s1, s2;
         ^~
prog.cpp:13:9: error: redeclaration of ‘std::__cxx11::string s2’
  string s2 = "Bob";
         ^~
prog.cpp:8:13: note: ‘std::__cxx11::string s2’ previously declared here
  string s1, s2;
             ^~
stdout
Standard output is empty