fork download
  1.  
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5. #define MAX 255
  6.  
  7. int myStrlen(char s[]);
  8. bool myStrcat(char s1[], char s2[]);
  9.  
  10. int main()
  11. {
  12. char s1[MAX], s2[MAX];
  13. cin.getline(s1,MAX);
  14. cin.getline(s2,MAX);
  15. bool kt = myStrcat(s1, s2);
  16.  
  17. if (kt==false) cout << "Khong noi duoc. Khong du bo nho.";
  18. else cout << s1 << s2;
  19. }
  20.  
  21.  
  22. bool myStrcat(char s1[], char s2[]){
  23. if (myStrlen(s1)+myStrlen(s2)>256) return false;
  24. return true;
  25.  
  26. }
  27.  
  28. int myStrlen(char s[]){
  29. int dem = 0;
  30. for (int i=0;s[i]!='\0';i++) ++dem;
  31. return dem;
  32. }
  33.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty