Search:

Type: Posts; User: Soulrivers

Search: Search took 0.00 seconds.

  1. Replies
    12
    Views
    11,112

    I would use a for loop to read every letter gone...

    I would use a for loop to read every letter gone through into a new string until a whitespace is encountered. Then begin to read into another string until another whitespace is found, and so on until...
  2. Replies
    16
    Views
    1,748

    You could call either std::cin.get(); or ...

    You could call either

    std::cin.get();
    or

    system("PAUSE");

    right before the return 0; at the end of main().

    Both of these will stall the program to wait for any user input before closing....
  3. Yeah yeah, I meant algorithm. :P

    Yeah yeah, I meant algorithm. :P
  4. I'm going to assume that you either haven't...

    I'm going to assume that you either haven't learned about vectors yet, or that you are trying to figure this out without using vectors. Anyway, using the vector function sort() would be a better...
  5. Replies
    26
    Views
    4,546

    Fine, I see your point. I'll try using only tabs...

    Fine, I see your point. I'll try using only tabs in the future, thanks.
  6. Replies
    26
    Views
    4,546

    How am I? If the tabs don't line up like I want...

    How am I? If the tabs don't line up like I want them to, I use spaces to put them in the right position.

    Thanks for the solve, Todd Burch, I see now what I did wrong. :p And no, this was not a...
  7. Replies
    26
    Views
    4,546

    #include #include ...

    #include <algorithm>
    #include <iostream>
    #include <string>
    #include <vector>

    using namespace std;

    int main()
    {
    // initialize the vector
  8. Replies
    26
    Views
    4,546

    The reason why I check if u == 0 is that I don't...

    The reason why I check if u == 0 is that I don't want the the loop to check for a match in the last word if it's the first word anyway, that'd be kind of pointless.

    First value for lastword? I use...
  9. Replies
    26
    Views
    4,546

    #include #include ...

    #include <algorithm>
    #include <iostream>
    #include <string>
    #include <vector>

    using namespace std;

    int main()
    {
    // initialize the vector
  10. Replies
    26
    Views
    4,546

    You're right, map hasn't been introduced yet,...

    You're right, map hasn't been introduced yet, though sort has. I'm guessing what you're getting at is to use sort to organise the strings in a decreasing (or non-decreasing) order, but how would I...
  11. Replies
    26
    Views
    4,546

    Counting input words

    So, this is the assignment:

    3-3. Write a program to count how many times each distinct word appears in its input.

    You might recognize it from Accelerated C++.

    I have come as far as to...
Results 1 to 11 of 11