fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <cctype>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string s1("Yes, we can!");
  9. string s2="";
  10. string::size_type size=0;
  11. for( string::size_type index=0; index< s1.size(); index++ )
  12. {
  13. if(!(ispunct(s1[index])))
  14. {
  15. s2[size]=s1[index];
  16. size++;
  17. }
  18. }
  19. cout<<s2<<endl;
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0.02s 2856KB
stdin
Standard input is empty
stdout