16. 아나그램

Run Settings
LanguageC
Language Version
Run Command
#include <stdio.h> #include <stdlib.h> #define MAX 100 int main(void) { char str1[MAX], str2[MAX]; int check1[53] = {0}, check2[53] = {0}; scanf("%s", str1); scanf("%s", str2); for (int i = 0; str1[i] != '\0'; i++) { // Str 1 if (str1[i] >= 65 && str1[i] <= 90) { check1[str1[i] - 65]++; } else { check1[str1[i] - 71]++; } // Str 2 if (str2[i] >= 65 && str2[i] <= 90) { check2[str2[i] - 65]++; } else { check2[str2[i] - 71]++; } } for (int i = 0; i < 53; i++) { if (check1[i] != check2[i]) { printf("NO\n"); return 0; } } printf("YES\n"); return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines