-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpangrams.cpp
More file actions
45 lines (37 loc) · 705 Bytes
/
Copy pathpangrams.cpp
File metadata and controls
45 lines (37 loc) · 705 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int counter[25];
void pangram(string s)
{
int result = 0;
for (int i = 0; i < s.length(); ++i)
{
if(s[i] != ' ')
{
if(s[i] < 97 )
{
if (counter[ s[i] + 32 - 97 ] == 0)
counter[s[i] + 32 - 97] = 1,
result++ ;
}
else if( counter[ s[i] - 97 ] == 0 )
counter[s[i] - 97] = 1,
result++ ;
}
}
if (result == 26)
cout<<"pangram"<<endl;
else
cout<<"not pangram"<<endl;
}
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
string input;
getline(cin, input);
pangram(input);
return 0;
}