Advertisement
black_canary_

Find the missing letters from ABC

Jan 19th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6.     string s;
  7.     cin >> s;
  8.     string missing="";
  9.     int add = 'a';
  10.     int alphabet[26] = {0};
  11.     for(char c: s)
  12.         alphabet[c-'a']++;
  13.     for(int i=0; i<26; i++)
  14.         if(!alphabet[i])
  15.             missing+=((char)(i + add));
  16.     cout << (missing.size() ? missing : "Panagram");
  17.  
  18.  
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement