Advertisement
Guest User

main

a guest
Jan 18th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. /// example.cpp
  2.  
  3. #include "LinkedList.h"
  4. #include <iostream>
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. int main() {
  10.     cout << "Please enter some words (ctrl-d to stop):\n";
  11.     LinkedList lst;
  12.     int count = 0;
  13.     string s;
  14.     while (cin >> s) {
  15.         count++;
  16.         lst.add(lst.remove_non_letters(s));
  17.        
  18.     } // while
  19.     cout << "\n" << count << " total words read in\n";
  20.     cout << lst.size() << " unique words read in\n\n";
  21.     lst.print();
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement