알고리즘/BOJ

백준 17863번 FYI

꾸준함. 2021. 3. 26. 03:16

문제 링크입니다: www.acmicpc.net/problem/17863

 

17863번: FYI

In the United States of America, telephone numbers within an area code consist of 7 digits: the prefix number is the first 3 digits and the line number is the last 4 digits. Traditionally, the 555 prefix number has been used to provide directory informatio

www.acmicpc.net

간단한 구현 문제였습니다.

 

#include <iostream>
#include <string>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(0);
cin.tie(0);
string N;
cin >> N;
cout << (N.substr(0, 3) == "555" ? "YES" : "NO") << "\n";
return 0;
}
view raw .cpp hosted with ❤ by GitHub

 

개발환경:Visual Studio 2017

 

지적, 조언, 질문 환영입니다! 댓글 남겨주세요~

반응형