daily pastebin goal
33%
SHARE
TWEET

Find the missing letters from ABC

black_canary_ Jan 19th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top