문자열(String)
-
백준 10988번: 팰린드롬인지 확인하기문자열(String) 2018. 6. 27. 21:07
https://www.acmicpc.net/problem/10988 1. 문제펠린드롬인지 확인 하는 문제 2. 알고리즘키워드 - 문자열, 펠린드롬 3. 코드 1234567891011121314151617181920212223242526272829303132333435363738394041424344#include #include // min#include #include #include #include #include #include #include #include #define M_PI 3.14159265358979323846 using namespace std; void isPalindrome(char str[]){ // Start from leftmost and rightmost corners of..
-
백준 1152번: 단어의 개수문자열(String) 2018. 6. 27. 20:21
https://www.acmicpc.net/problem/1152 1. 문제영어 대소문자와 띄어쓰기만으로 이루어진 문장이 주어진다. 이 문장에는 몇 개의 단어가 있을까? 이를 구하는 프로그램을 작성하시오. 2. 알고리즘키워드 - 문자열 3. 코드 12345678910111213141516171819#include main() { int i; char s[1000001] = { 0 }; int count = 0,butt=1; gets(s); for (i = 0; i > s; getline(cin, s); bool prvAlpha = false; int sol = 0; for (int i = 0; i = 'a' && ch
-
백준 15837번 : 백준 온라인 저지문자열(String) 2018. 6. 20. 10:26
https://www.acmicpc.net/problem/15857 1. 문제백준 온라인 저지 사용에 대한 문제. 2. 알고리즘각 문제 별 답안을 출력한다. 3. 코드1234567891011121314151617181920212223// input your code here#include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { std::ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; string s = " abbcdddc"; cout
-
Codeforces Round #486 (Div. 3) - B. Substrings Sort문자열(String) 2018. 6. 19. 11:54
https://codeforces.com/contest/988/problem/B 1. 문제B. Substrings Sorttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given nn strings. Each string consists of lowercase English letters. Rearrange (reorder) the given strings in such a way that for every string, all strings that are placed before it are its substrings. String aa is a subs..
-
프로그래머스 Level1 > 문자열 내 p와 y의 개수문자열(String) 2018. 6. 14. 18:00
https://programmers.co.kr/learn/courses/30/lessons/12916 1. 문제 요약 입력받은 문자열에서 p와 y 의 개수가 같으면 true 를 반환하고 아니면 false 를 반환 하는 문제 2. 알고리즘 입력 받은 문자열을 소문자로 치환 한다. p, y 값을 카운팅 하여 같으면 true, 다르면 false 를 반환 한다. 3. 코드 123456789101112131415161718192021222324252627282930#include #include #include #include using namespace std; bool solution(string s){ bool answer = true; const int size = s.size(); int count_p ..
-
백준 1302번: 베스트셀러문자열(String) 2018. 6. 13. 19:04
https://www.acmicpc.net/problem/1302 1. 문제 요약 가장 빈도가 높은 문자열 출력 하는 문제 2. 알고리즘 문자열을 입력받아 map 삽입한다. 가장많이 호출된 string 을 출력한다. 3. 코드 1234567891011121314151617181920212223242526272829303132333435363738#include #include #include #include #include // greater 사용 위해 필요 #include #include #include using namespace std; int main() { std::ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; map m; while(n-..
-
백준 3181번: 줄임말 만들기문자열(String) 2018. 6. 13. 11:00
백준 온라인 저지(BOJ) 3181번 문제 https://www.acmicpc.net/problem/3181 1. 문제 요약 입력 받는 문자열에서 공백과 문제에서 주어진 특정 단어를 제외하고 각 단어의 첫 글자를 대문자로 출력 하는 문제 2. 알고리즘 문자열을 입력 받는다. 공백 단위로 문자열을 분리 한다. 각 단어의 첫 글자를 대문자로 출력한다. 3. 코드 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#include #include // min#include #include #include #include #include #include #include #include using names..