[ create a new paste ] login | about

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

C, pasted on Dec 14:
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;

int main()
{
char str[200];
int len;
while(gets(str)!=NULL)
{
    if(str[0]=='#')
        break;
    len=strlen(str);
    if(next_permutation(str,str+len)==1)
        printf("%s\n",str);
    else
        printf("No Successor\n");


}
return 0;
}


Output:
1
2
3
4
5
6
7
Line 18: error: iostream: No such file or directory
Line 16: error: cstdio: No such file or directory
Line 19: error: algorithm: No such file or directory
Line 17: error: cstring: No such file or directory
Line 6: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'
In function 'main':
Line 16: warning: incompatible implicit declaration of built-in function 'strlen'


Create a new paste based on this one


Comments: