#include <stdio.h>
#include <ctype.h>
#define MAX 5
int comparacao(char s1[], char s2[], int n) {
int i = 0;
return i == n;
}
int main() {
char s1_m[MAX] = {'a', 'b', 'c', 'd', 'e'}, s2_m[MAX] = {'a', 'b', 'c', 'D', 'E'};
int n_m;
printf("quantos caracteres serao verificados(max 5)\n> "); scanf("%d", &n_m
); printf("os %d primeiros caracteres dos dois vetores %ssao iguais", n_m
, comparacao
(s1_m
, s2_m
, n_m
) ? "" : "nao "); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxjdHlwZS5oPgojZGVmaW5lIE1BWCA1CgppbnQgY29tcGFyYWNhbyhjaGFyIHMxW10sIGNoYXIgczJbXSwgaW50IG4pIHsKCWludCBpID0gMDsKICAgIGZvciAoOyBpIDwgbiAmJiB0b2xvd2VyKHMxW2ldKSA9PSB0b2xvd2VyKHMyW2ldKTsgaSsrKTsKICAgIHJldHVybiBpID09IG47Cn0KCmludCBtYWluKCkgewogICAgY2hhciBzMV9tW01BWF0gPSB7J2EnLCAnYicsICdjJywgJ2QnLCAnZSd9LCBzMl9tW01BWF0gPSB7J2EnLCAnYicsICdjJywgJ0QnLCAnRSd9OwogICAgaW50IG5fbTsKICAgIHByaW50ZigicXVhbnRvcyBjYXJhY3RlcmVzIHNlcmFvIHZlcmlmaWNhZG9zKG1heCA1KVxuPiAiKTsgc2NhbmYoIiVkIiwgJm5fbSk7CiAgICBwcmludGYoIm9zICVkIHByaW1laXJvcyBjYXJhY3RlcmVzIGRvcyBkb2lzIHZldG9yZXMgJXNzYW8gaWd1YWlzIiwgbl9tLCBjb21wYXJhY2FvKHMxX20sIHMyX20sIG5fbSkgPyAiIiA6ICJuYW8gIik7CiAgICByZXR1cm4gMDsKfQo=