[ create a new paste ] login | about

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

C, pasted on Jul 28:
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
	int n;
	scanf_s("%d", &n);
	int a, b, c, d;
	for (int i = n + 1; i < 10000; i++)
	{
		a = i / 1000;
		b = i / 100 % 10;
		c = i / 10 % 10;
		d = i % 10;
		if (a != b && a != c && a != d && b != c && b != d && c != d)
		{
			printf("%d", i);
			break;
		}
	}
	return 0;
}


Output:
1
2
3
4
Line 18: error: iostream: No such file or directory
Line 3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'
In function 'main':
Line 9: error: 'for' loop initial declaration used outside C99 mode


Create a new paste based on this one


Comments: