/*
文字列1と文字列2を1文字ずつ比較し、等しければ1を等しくなければ0を返すユーザー関数を
作成しなさい。※ポインタをつかうこと
*/
#include <stdio.h>
int str_equal(char *s1, char *s2);
int main(void)
{
char str1[100],str2[100];
if(str_equal(str1,str2))
{
}
else
{
}
return 0;
}
int str_equal(char *s1, char *s2)
{
/*
for文かwhile文でまわす
*/
if(*s1 == *s2)
{
return 1;
}
else
{
return 0;
}
}
LyoK5paH5a2X5YiXMeOBqOaWh+Wtl+WIlzLjgpIx5paH5a2X44Ga44Gk5q+U6LyD44GX44CB562J44GX44GR44KM44GwMeOCkuetieOBl+OBj+OBquOBkeOCjOOBsDDjgpLov5TjgZnjg6bjg7zjgrbjg7zplqLmlbDjgpIK5L2c5oiQ44GX44Gq44GV44GE44CC4oC744Od44Kk44Oz44K/44KS44Gk44GL44GG44GT44GoCiovCgojaW5jbHVkZSA8c3RkaW8uaD4KCmludCBzdHJfZXF1YWwoY2hhciAqczEsIGNoYXIgKnMyKTsKaW50IG1haW4odm9pZCkKewoJY2hhciBzdHIxWzEwMF0sc3RyMlsxMDBdOwoJCglwcmludGYoIuaWh+Wtl+WIlzHjgpLlhaXlipvjgZfjgabjgY/jgaDjgZXjgYQgOiAiKTsKCXNjYW5mKCIlcyIsc3RyMSk7CglwcmludGYoIuaWh+Wtl+WIlzLjgpLlhaXlipvjgZfjgabjgY/jgaDjgZXjgYQgOiAiKTsKCXNjYW5mKCIlcyIsc3RyMik7CgkKCWlmKHN0cl9lcXVhbChzdHIxLHN0cjIpKQoJewoJCXByaW50Zigi5paH5a2X5YiXMeOBqOaWh+Wtl+WIlzLjga/lkIzkuIDjgafjgZlcbiIpOwoJfQoJZWxzZQoJewoJCXByaW50Zigi5paH5a2X5YiXMeOBqOaWh+Wtl+WIlzLjga/nlbDjgarjgorjgb7jgZlcbiIpOwoJfQoJCglyZXR1cm4gMDsKfQoKaW50IHN0cl9lcXVhbChjaGFyICpzMSwgY2hhciAqczIpIAp7IAoJLyoKCWZvcuaWh+OBi3doaWxl5paH44Gn44G+44KP44GZCgkqLwoKCglpZigqczEgPT0gKnMyKQoJewoJCXJldHVybiAxOwoJfQoJZWxzZQoJewoJCXJldHVybiAwOwoJfQp9Cg==