안녕하세요. 오늘은 팬그램을 확인해볼 거예요.
https://www.acmicpc.net/problem/5704
문자열을 getline으로 받아서 한번에 모든 줄을 입력받은 다음, 문자가 있는지 없는지 확인하고 하나라도 없으면 N을 출력해주면 됩니다.
#include <iostream>
#include <string>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false); cin.tie(NULL);
string s;
while (true)
{
getline(cin, s);
if (s == "*") break;
bool ck[26] = { 0 };
for (char c : s)
if (c != ' ')
ck[c - 'a'] = true;
bool able = true;
for (int i = 0; i < 26; i++)
if (ck[i] == 0)
able = false;
if (able) cout << "Y\n";
else cout << "N\n";
}
}
감사합니다.