lamchau
4/24/2014 - 8:20 AM

alphabet.cpp

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

int main() {
  // create alphabet (lowercase)
  char letters[26];
  for (int i = 0; i < 26; i++) {
    letters[i] = 'a' + i;
  }
  
  string str(letters, 26);
  cout << str << endl;
  
  // convert to uppercase
  transform(str.begin(), str.end(), str.begin(), ::toupper);
  cout << str << endl;
  return 0;
}