# include # include using namespace std; int main ( ) // // FREQUENCY reads input until terminated by an end of file. // // It counts the number of lower or uppercase letters 'E' and 'T', // and at the end prints the counts. // // The output is printed in such a way that it can be plotted by gnuplot // using the command: // // plot "count.txt" using 1:2 with boxes // // or, for a nicer plot, // // set yrange [0:180] // set style fill solid // plot "count.txt" using 1:2:(0.90):xtic(3) with boxes { char c; int ecount = 0; int tcount = 0; while ( true ) { c = cin.get ( ); if ( cin.eof ( ) ) { break; } switch ( c ) { case 'E': case 'e': ecount++; break; case 'T': case 't': tcount++; break; default: break; } } cout << " 1 " << ecount << " E/e\n"; cout << " 2 " << tcount << " T/t\n"; return 0; }