[c언어] 같은 단어 판별하기
두 개의 단어를 입력 받아서 같은가 다른가를 판별하는 프로그램을 작성한다. #include int main(void) { char word1[81], word2[81]; int i, j = 0, same = 0; printf("Enter the first word: "); scanf("%s", word1); printf("Enter the second word: "); scanf("%s", word2); for (i = 0; word1[i] != '\0'||word2[i]!='\0'; i++) { if (word1[i] == word2[j]) { same = 1; j++; } else { same = 0; break; } } word1[i] = '\0'; word2[j] = '\0'; if (same =..
2020.12.16