목록C++/C++ 문제 (10)
사자자리

https://www.acmicpc.net/problem/1157 1157번: 단어 공부 알파벳 대소문자로 된 단어가 주어지면, 이 단어에서 가장 많이 사용된 알파벳이 무엇인지 알아내는 프로그램을 작성하시오. 단, 대문자와 소문자를 구분하지 않는다. www.acmicpc.net #include using namespace std; int main() { int alphabet[26] = {0}, max = 0, max_alpha, max_count = 0; string word; cin >> word; for (int i = 0; i < word.length(); i++) {//ASCII 코드를 사용하여 대소문자 문제 해결 if (word[i] < 97) alphabet[word[i] - 65]++;//..

https://www.acmicpc.net/problem/8958 8958번: OX퀴즈 "OOXXOXXOOO"와 같은 OX퀴즈의 결과가 있다. O는 문제를 맞은 것이고, X는 문제를 틀린 것이다. 문제를 맞은 경우 그 문제의 점수는 그 문제까지 연속된 O의 개수가 된다. 예를 들어, 10번 문제의 점수 www.acmicpc.net #include #include using namespace std; int main() { int n, score = 0, sum = 0; char test[80]; cin >> n; for (int i = 0; i > test; for (int j = 0; j < strlen(test); j++) { if (test[j] == 'O') scor..