Code:
#include <iostream> #include <cctype> using namespace std; int main(int argc, char *argv[], char **env) { char c, lastc = ' ' ; c= cin.get(); do { if(isalpha(c)) //determines if it is alphabetic cout << (char)toupper(c); //capitalizes and outputs else cout << c; // if not alphabetic, outputs with no change lastc = c; } while(cin.get(c)); }
Comment