일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 주정부이민
- omscs
- Plotting
- 알고리즘
- 조지아텍
- 선형대수
- machine learning
- LAA
- mpnp
- 온라인석사
- 방송통신대학교
- zeros
- 프로그래머스
- C++
- 개발자
- 코딩테스트
- 방통대
- 캐나다 영주권
- MATLAB
- 기본
- LV1
- cpp
- leetcode
- EOI
- 머신러닝
- 컴퓨터과학과
- 마니토바
- 딥러닝
- 매트랩
- Deep learning
Archives
- Today
- Total
Krononberg
프로그래머스) 문자열 내 p와 y의 개수 c++ 본문
#include <string>
#include <iostream>
#include <cctype>
using namespace std;
bool solution(string s)
{
bool answer = true;
int count =0;
for(int i =0; i<s.size(); i++){
if(tolower(s[i])=='p') count++;
else if(tolower(s[i])=='y')count--;
}
if(count) answer = false;
return answer;
}
'개발 로그 > 알고리즘' 카테고리의 다른 글
프로그래머스) 월간코드챌린지2_약수의 개수와 덧셈 c++ (0) | 2021.09.03 |
---|---|
프로그래머스) 비밀지도 c++ (카카오코테1차) (0) | 2021.09.03 |
프로그래머스) 문자열 다루기 기본 c++ (0) | 2021.09.03 |
프로그래머스) 3진법 뒤집기 c++ (0) | 2021.09.03 |
프로그래머스) 실패율 c++ (0) | 2021.09.02 |