/*If pw == in returns 1, else returns 0 */
int compVar (char *pw, char *in) {
int i;
for (i=0; i<7 class="text_exposed_show" i="" span="" style="display: inline; font-family: inherit;">
if (pw[i]!=in[i]) {
return 0;
}
}
return 1;
}7>
int main(void) {
int comp=1;
char pw[]="secret";
char in[7];
int result;
scanf ("%s", in);
result = compVar(pw, in);
printf ("%d", result);
}
int comp=1;
char pw[]="secret";
char in[7];
int result;
scanf ("%s", in);
result = compVar(pw, in);
printf ("%d", result);
}
No comments:
Post a Comment