Problem Input Arduino Due

Hello, sorry for my English but I have a problem with my Arduino Due.
If I try to read the status of an Arduino button returns incorrect values ??.... What can it be??
I write the code below, the circuit diagram and the one that gives me back unless I hit the button:

Program:

int x;
void setup()
{
Serial.begin(9600);
pinMode(40,INPUT);
}

void loop()
{
x=digitalRead(40);
if (x==HIGH)
{
Serial.println("ACCESO");
}
else
{
Serial.println("SPENTO");
}
delay(1000);
}

Diagram:
http://www.23hq.com/Vipandrea/photo/8972428/original

OUTPUT:
http://www.23hq.com/Vipandrea/photo/8972695/original

it is possible that the I / O pins (all pins) there is always an intention to 0.5 V ??

From your diagram, it looks like when the button is pressed the line is pulled up to 3.3V, but when it is open, the input is floating so its value can vary. You might want to add a pull-down resistor so that the input is definitely low when the button isn't being pressed.

You are leaving your button floating, which will cause random values.

You can use the external pull-down that steronydh suggestions or you can use the Internal pull-up of the Arduino.

Move your connection from 3V3 to GND. Then in your code use:
pinMode(40,INPUT_PULLUP);

Note: When the button is not pressed the value will be HIGH. When the button is pressed the value will be LOW.

To understand why this happens, see the videos I have here (these are with a Uno, but some applies to the Due):
http://www.cmiyc.com/tutorials/arduino-pull-ups/