#include #include #include "stack.h" using namespace std; int main() { string line; while ( getline(cin, line) ) { // Add stack declarations here istringstream iss(line); double n; string w; do { if ( iss >> n ) { // Successfully read a number // Do something clever... } else { iss.clear(); if ( iss >> w ) { // Successfully read a word // Do something clever... } } } while ( ! iss.eof() ); // Code to print the line with words in original order and numbers // in revers order - see example } return 0; }