Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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
- 알고리즘
- 자료구조
- c++
- 스택
- OS
- 오퍼레이팅시스템
- 컴공과
- Operating System
- 코테
- 컴공
- 코딩
- 너비우선탐색
- 정석
- 구현
- 정석학술정보관
- Computer science
- DP
- vector
- 브루트포스
- cs
- 문제풀이
- 오에스
- bfs
- 그래프
- 북리뷰
- coding
- 컴퓨터공학과
- 개발
- 백준
- Stack
Archives
- Today
- Total
Little Jay
[C++] 백준 1259번 팰린드롬수 본문
#include <iostream>
#include <string>
using namespace std;
int main() {
bool check = true;
while (check) {
string s;
cin >> s;
if (s == "0") {
break;
}
int len = s.length();
int count = 0;
for (int i = 0; i < len - 1; i++) {
if (s[i] == s[len - i - 1]) {
continue;
}
else {
count++;
}
}
if (count > 0) {
cout << "no" << "\n";
}
else {
cout << "yes" << "\n";
}
}
return 0;
}'알고리즘 > BOJ' 카테고리의 다른 글
| [C++] 백준 1085번 직사각형에서 탈출 (0) | 2021.03.11 |
|---|---|
| [C++] 백준 2751번 수 정렬하기 2 (0) | 2021.03.11 |
| [C++] 백준 10951번 A+B - 4 (0) | 2021.03.08 |
| [C++] 백준 10818번 최소, 최대 (0) | 2021.03.08 |
| [C++] 백준 8958번 OX퀴즈 (0) | 2021.03.08 |
Comments