#include <stdio.h>
#include <string.h>
char *mystrcat(char *str1,char *str2);
int main(int argc, const char *argv[])
{
char arr[30] = "";
char brr[30] = "";
gets(arr);
gets(brr);
printf("%s\n",mystrcat(arr,brr));
return 0;
}
char *mystrcat(char *str1,char *str2)
{
char *pa = str1;
char *pb = str2;
int len = strlen(pa);
for(int i=0;i<len;i++)
{
*(pa+len) = *pb;
pa++;
pb++;
}
return str1;
#include<stdio.h>
#include<string.h>
int mystrcmp(char *str1,char *str2);
int main(int argc, const char *argv[])
{
char arr[30] = "";
char brr[30] = "";
gets(arr);
gets(brr);
int result = mystrcmp(arr,brr);
printf("%d",result);
return 0;
}
int mystrcmp(char *str1,char *str2)
{
int result=0;
while(*str1 !='\0' || *str2 != '\0' )
{
if(*str1 != *str2)
{
result = *str1-*str2;
break;
}
str1++;
str2++;
}
return result;
}