Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- using namespace std;
- int main(){
- string str = "abcd";
- int N = 1<<str.size();
- for (int i=0; i<N; i++) {
- for (int j=0; j<str.size(); j++) {
- if ((i>>j) & 1) {
- cout<<str[j];
- }
- }
- cout<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement