36 lines
774 B
C
36 lines
774 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdbool.h>
|
|
|
|
int main() {
|
|
char str[2][26] = {0};
|
|
int count[2][26] = {0};
|
|
int i = 0, length = 0;
|
|
bool same = true;
|
|
scanf("%s", str[0]);
|
|
scanf("%s", str[1]);
|
|
if (strlen(str[0]) != strlen(str[1])) {
|
|
printf("0");
|
|
}
|
|
else {
|
|
length = strlen(str[0]);
|
|
for (i = 0; i < length; i++) {
|
|
count[0][str[0][i]%26]++;
|
|
count[1][str[1][i]%26]++;
|
|
}
|
|
for (i = 0; i < 26; i++) {
|
|
if (count[0][i] != count[1][i]) {
|
|
same = false;
|
|
break;
|
|
}
|
|
}
|
|
if (same) {
|
|
printf("1");
|
|
}
|
|
else {
|
|
printf("0");
|
|
}
|
|
printf("\n");
|
|
}
|
|
return 0;
|
|
} |