LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
switch (message)
{
case WM_CREATE:
return 0;
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint(hwnd, &ps);
FillRect(hdc, &ps.rcPaint, (HBRUSH)(COLOR_WINDOW + 1));
EndPaint(hwnd, &ps);
}
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
import java.lang.Math;
import java.util.*;
public class SuperRandom
{
private ArrayList<Integer> numbers;
private Random rand;
public static void main(String[] args)
{
SuperRandom sr=new SuperRandom(10);
for(int i=0;i<10;i++)
System.out.print(sr.getValue());
}
public SuperRandom(int size){
rand=new Random();
numbers=new ArrayList<>();
for(int i=0;i<size;i++)
numbers.add(i);
}
public int getValue(){
int randomIndex=rand.nextInt(numbers.size());
return numbers.remove(randomIndex);
}
public int getSize(){
return numbers.size();
}
}
void moveMouseLine(int endX, int endY)
{
int d = 0;
POINT p;
GetCursorPos(&p);
int currentX = p.x;
int currentY = p.y;
int dx = abs(endX - currentX);
int dy = abs(endY - currentY);
int dx2 = 2 * dx; // slope scaling factors to
int dy2 = 2 * dy; // avoid floating point
int ix = currentX < endX ? 1 * Const::MIN_MOUSE_SPEED : -1 * Const::MIN_MOUSE_SPEED; // increment direction
int iy = currentY < endY ? 1 * Const::MIN_MOUSE_SPEED : -1 * Const::MIN_MOUSE_SPEED;
int x = currentX;
int y = currentY;
int pauseLenght = 500/(dx+dy+1)+10;
if (dx >= dy) {
while (true) {
moveMouse(x, y);
if (abs(x - endX) < Const::MAX_MOUSE_SPEED) {
moveMouse(endX, endY);
break;
}
x += ix;
d += dy2;
if (d > dx) {
y += iy;
d -= dx2;
}
Sleep(pauseLenght);
}
}
else {
while (true) {
moveMouse(x, y);
if (abs(y - endY) < Const::MAX_MOUSE_SPEED) {
moveMouse(endX, endY);
break;
}
y += iy;
d += dx2;
if (d > dy) {
x += ix;
d -= dy2;
}
Sleep(pauseLenght);
}
}
}
n = int(input("Enter number:"))
c = n-1
a = n+1
exceptionLine="Error, the entered number exceeded the limit"
outputLine="The next number for the number "+str(n)+" is "+ str(a)+ "\n The previous number for the number "+ str(n)+ " is "+ str(c)
n_type = (outputLine, exceptionLine)
print(n_type[n>10000])