티스토리 뷰
728x90
toupper() = 대문자로 바꾸기
tolower() = 소문자로 바꾸기
#include <iostream>
using namespace std;
int main(){
char maxCh;
int maxCnt = 0;
int secondMaxCnt = 0;
int alpaList[26] ={0};
string str;
int indx;
getline(cin,str);
for(int i=0; i<str.length(); i++){
if(str[i] < 97) alpaList[str[i] - 'A']++;
else alpaList[str[i] - 'a']++;
}
for(int i=0;i<26;i++){
if(maxCnt <= alpaList[i]){
secondMaxCnt = maxCnt;
maxCnt = alpaList[i];
maxCh = toupper('A'+i);
}
}
if(secondMaxCnt == maxCnt) cout << "?";
else cout << maxCh;
}
728x90
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Winform
- apt
- DevExpress
- GIT
- androidstudio
- QO
- select
- gridContorl
- 트리
- multiple Column
- mac unity vscode autocomplete
- Flutter
- apt-get
- DataSource
- Unity vs code
- 버추얼박스
- =
- 컨셉때문에킹받으셨나요..죄송합니다..제가 봐도 킹받네요
- 우분투
- Unity
- 해마코딩
- mac Unity vscode 자동완성
- Tree
- Mac
- VS Code
- flutterdoctor
- Query
- ()
- VirtualBox
- ubuntu
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함
Blog is powered by
Tistory / Designed by
Tistory