[ create a new paste ] login | about

Link: http://codepad.org/cgQ5XKch    [ raw code | output | fork ]

anmartex - C++, pasted on Jan 27:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include <string>

int main() {
    std::string str = "qwe";

    for (unsigned i = 0; i < str.length(); ++i) {
        for (unsigned j = 0; j < str.length() - i; ++j) {
            std::cout << std::string(str, j, i + 1) << " ";
        }
    }

    return 0;
}


Output:
1
q w e qw we qwe 


Create a new paste based on this one


Comments: