Notice
Recent Posts
Recent Comments
Link
알고리즘 모음(C++)
백준 4999 - 아!(C++) 본문
문제 링크입니다. https://www.acmicpc.net/problem/4999
4999번: 아!
입력은 두 줄로 이루어져 있다. 첫째 줄은 재환이가 가장 길게 낼 수 있는 "aaah"이다. 둘째 줄은 의사가 듣기를 원하는 "aah"이다. 두 문자열은 모두 a와 h로만 이루어져 있다. a의 개수는 0보다 크거
www.acmicpc.net
두 문자열의 길이를 비교하면 되는 문제였습니다.
자세한 것은 코드를 참고해주세요.
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstring>
#include <cmath>
#include <string>
#include <map>
using namespace std;
string x, y;
int main(){
cin.tie(0);
cout.tie(0);
cin >> x >> y;
if(x.size() >= y.size()) cout << "go";
else cout << "no";
return 0;
}
질문 및 조언은 댓글을 남겨주세요.
'백준' 카테고리의 다른 글
백준 4358 - 생태학(C++) (0) | 2023.06.18 |
---|---|
백준 1212 - 8진수 2진수(C++) (0) | 2023.06.18 |
백준 1120 - 문자열(C++) (0) | 2023.06.11 |
백준 1213 - 펠린드롬 만들기(C++) (0) | 2023.06.11 |
백준 2935 - 소음(C++) (0) | 2023.06.09 |