#include using namespace std; main() { int i, length,firsthalf,secondhalf,spaces,quotes,pairs,punctuation; char c, string[81]; i = 0; length = 0; firsthalf = 0; secondhalf = 0; spaces = 0; pairs = 0; quotes = 0; punctuation = 0; while ( string[i] != '\n' ) { ++i; string[i] = getchar(); ++length; } for (i=1; i= 'a') && (string[i] <= 'm')) || ((string[i] >= 'A') && (string[i] <= 'M')) ) ++firsthalf; else if ( ( (string[i] >= 'n') && (string[i] <= 'z')) || ((string[i] >= 'N') && (string[i] <= 'Z')) ) ++secondhalf; else if (string[i] == ' ') ++spaces; else if ( (string[i] == '\'') || (string[i] == '"') ) ++quotes; else if ( (string[i] == ')') || (string[i] == '(') || (string[i] == '<') || (string[i] == '>') || (string[i] == '}') || (string[i] == '{') || (string[i] == '[') || (string[i] == ']') ) ++pairs; else ++punctuation; } cout << "First Half: " << firsthalf << endl; cout << "Second Half: " << secondhalf << endl; cout << "Spaces: " << spaces << endl; cout << "Quotes: " << quotes << endl; cout << "Pairs: " << pairs << endl; cout << "Punctuation: " << punctuation << endl; // while(1) // {} }