fork download
  1. //文字の足し算
  2. # include <stdio.h>
  3.  
  4. void myStrcat(char s[], char t[]){
  5. int i,j;
  6. for(i=0;s[i]!='\0';i++)
  7. ;
  8. for(j=0;t[j]!='\0';j++){
  9. s[i+j] = t[j];
  10. }
  11. s[i+j] = '\0';
  12. return;
  13. }
  14.  
  15. int main(){
  16. char s[100];
  17. char t[100];
  18. scanf("%s %s",s,t);
  19. printf("%s + %s",s,t);
  20. myStrcat(s,t);
  21. printf(" -> %s\n",s);
  22. return 0;
  23. }
  24. //abc def 答え
Success #stdin #stdout 0.01s 5320KB
stdin
abc def
stdout
abc + def -> abcdef