Problem p02417 (C++) — buggy submission, verdict: Runtime Error

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {

  std::string Letter;
  int Count[26] = {0};

  while (getline(cin, Letter)) {

    for (int i = 0; i < 26; i++) {
      int p = i;
      char alphabet;
      char Alphabet;

      if (p == 0)
        alphabet = 'a';
      if (p == 1)
        alphabet = 'b';
      if (p == 2)
        alphabet = 'c';
      if (p == 3)
        alphabet = 'd';
      if (p == 4)
        alphabet = 'e';
      if (p == 5)
        alphabet = 'f';
      if (p == 6)
        alphabet = 'g';
      if (p == 7)
        alphabet = 'h';
      if (p == 8)
        alphabet = 'i';
      if (p == 9)
        alphabet = 'j';
      if (p == 10)
        alphabet = 'k';
      if (p == 11)
        alphabet = 'l';
      if (p == 12)
        alphabet = 'm';
      if (p == 13)
        alphabet = 'n';
      if (p == 14)
        alphabet = 'o';
      if (p == 15)
        alphabet = 'p';
      if (p == 16)
        alphabet = 'q';
      if (p == 17)
        alphabet = 'r';
      if (p == 18)
        alphabet = 's';
      if (p == 19)
        alphabet = 't';
      if (p == 20)
        alphabet = 'u';
      if (p == 21)
        alphabet = 'v';
      if (p == 22)
        alphabet = 'w';
      if (p == 23)
        alphabet = 'x';
      if (p == 24)
        alphabet = 'y';
      if (p == 25)
        alphabet = 'z';

      if (p == 0)
        Alphabet = 'A';
      if (p == 1)
        Alphabet = 'B';
      if (p == 2)
        Alphabet = 'C';
      if (p == 3)
        Alphabet = 'D';
      if (p == 4)
        Alphabet = 'E';
      if (p == 5)
        Alphabet = 'F';
      if (p == 6)
        Alphabet = 'G';
      if (p == 7)
        Alphabet = 'H';
      if (p == 8)
        Alphabet = 'I';
      if (p == 9)
        Alphabet = 'J';
      if (p == 10)
        Alphabet = 'K';
      if (p == 11)
        Alphabet = 'L';
      if (p == 12)
        Alphabet = 'M';
      if (p == 13)
        Alphabet = 'N';
      if (p == 14)
        Alphabet = 'O';
      if (p == 15)
        Alphabet = 'P';
      if (p == 16)
        Alphabet = 'Q';
      if (p == 17)
        Alphabet = 'R';
      if (p == 18)
        Alphabet = 'S';
      if (p == 19)
        Alphabet = 'T';
      if (p == 20)
        Alphabet = 'U';
      if (p == 21)
        Alphabet = 'V';
      if (p == 22)
        Alphabet = 'W';
      if (p == 23)
        Alphabet = 'X';
      if (p == 24)
        Alphabet = 'Y';
      if (p == 25)
        Alphabet = 'Z';

      for (int j = 0; j < Letter.size(); j++) {
        if (Letter[j] == alphabet || Letter[j] == Alphabet)
          Count[i] += 1;
      }
    }
  }

  char alphabet[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                       'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                       's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
  for (int i = 0; i < 26; i++) {
    cout << alphabet[i] << " : " << Count[i] << endl;
  }
  return 0;
}

Error: 0

Fixed submission:

#pragma hdrstop
#include <iostream>
#include <vector>
#pragma argsused

int main(int argc, char *argv[]) {

  using namespace std;

  vector<char> Sentence;
  int flag = 0;
  int size = 0;

  while (flag == 0) {
    char Letter;
    cin >> Letter;
    Sentence.push_back(Letter);
    // Sentence.push_back?????¢??°??§???????????§cin >> ????????????????????????
    if (Letter == '.')
      flag = 1;
    size++;
  }

  for (int i = 0; i < 26; i++) {
    int p = i;
    char alpabet;
    char Alpabet;
    int Count = 0;

    if (p == 0)
      alpabet = 'a';
    if (p == 1)
      alpabet = 'b';
    if (p == 2)
      alpabet = 'c';
    if (p == 3)
      alpabet = 'd';
    if (p == 4)
      alpabet = 'e';
    if (p == 5)
      alpabet = 'f';
    if (p == 6)
      alpabet = 'g';
    if (p == 7)
      alpabet = 'h';
    if (p == 8)
      alpabet = 'i';
    if (p == 9)
      alpabet = 'j';
    if (p == 10)
      alpabet = 'k';
    if (p == 11)
      alpabet = 'l';
    if (p == 12)
      alpabet = 'm';
    if (p == 13)
      alpabet = 'n';
    if (p == 14)
      alpabet = 'o';
    if (p == 15)
      alpabet = 'p';
    if (p == 16)
      alpabet = 'q';
    if (p == 17)
      alpabet = 'r';
    if (p == 18)
      alpabet = 's';
    if (p == 19)
      alpabet = 't';
    if (p == 20)
      alpabet = 'u';
    if (p == 21)
      alpabet = 'v';
    if (p == 22)
      alpabet = 'w';
    if (p == 23)
      alpabet = 'x';
    if (p == 24)
      alpabet = 'y';
    if (p == 25)
      alpabet = 'z';

    if (p == 0)
      Alpabet = 'A';
    if (p == 1)
      Alpabet = 'B';
    if (p == 2)
      Alpabet = 'C';
    if (p == 3)
      Alpabet = 'D';
    if (p == 4)
      Alpabet = 'E';
    if (p == 5)
      Alpabet = 'F';
    if (p == 6)
      Alpabet = 'G';
    if (p == 7)
      Alpabet = 'H';
    if (p == 8)
      Alpabet = 'I';
    if (p == 9)
      Alpabet = 'J';
    if (p == 10)
      Alpabet = 'K';
    if (p == 11)
      Alpabet = 'L';
    if (p == 12)
      Alpabet = 'M';
    if (p == 13)
      Alpabet = 'N';
    if (p == 14)
      Alpabet = 'O';
    if (p == 15)
      Alpabet = 'P';
    if (p == 16)
      Alpabet = 'Q';
    if (p == 17)
      Alpabet = 'R';
    if (p == 18)
      Alpabet = 'S';
    if (p == 19)
      Alpabet = 'T';
    if (p == 20)
      Alpabet = 'U';
    if (p == 21)
      Alpabet = 'V';
    if (p == 22)
      Alpabet = 'W';
    if (p == 23)
      Alpabet = 'X';
    if (p == 24)
      Alpabet = 'Y';
    if (p == 25)
      Alpabet = 'Z';

    for (int j = 0; j < size; j++) {
      if (Sentence[j] == alpabet || Sentence[j] == Alpabet)
        Count += 1;
    }
    cout << alpabet << " : " << Count << endl;
  }
  return 0;
}