Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t;
- cin>>t;
- for(int i=1;i<=t;i++)
- {
- int n,k,j=0;
- cin>>n>>k;
- string s;
- for(int i=0;i<n;i++)
- {
- char c=char(i+65);
- s+=c;
- }
- cout<<"Case "<<i<<":\n";
- do
- {
- cout<<s<<endl;
- j++;
- if(j==k) break;
- }while(next_permutation(s.begin(),s.end()));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement