3はなんとか出来たけど、おいらの力じゃ4は苦労しそう・・・

#include <stdio.h>
#include <stdlib.h>

int strcmp(char s1[], char s2[])
{
int i;
for (i = 0; s1[i] != '\0'; i++)
if (s1[i] != s2[i]) return 1;
return 2;
}

int main(){
char str[100];
int ans;