poj 1146(next_permutation(data,data+len)的用法)
#include<iostream> using namespace std; #include<algorithm> #include<cstring> int main(){ char data[55]; while(scanf("%s",data)==1&&strcmp(data,"#")!=0){ if(next_permutation(data,data+strlen(data))){ printf("%s\n",data); } else{ printf("No Successor\n"); } } return 0; }
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号