Click here to Skip to main content
15,882,464 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: Website Build Help!! Please Pin
Afzaal Ahmad Zeeshan17-Feb-17 21:09
professionalAfzaal Ahmad Zeeshan17-Feb-17 21:09 
SuggestionRe: Website Build Help!! Please Pin
Richard Deeming18-Feb-17 1:22
mveRichard Deeming18-Feb-17 1:22 
QuestionAngular JS code Not work Pin
Member 1300557216-Feb-17 4:44
Member 1300557216-Feb-17 4:44 
AnswerRe: Angular JS code Not work Pin
Richard MacCutchan16-Feb-17 5:37
mveRichard MacCutchan16-Feb-17 5:37 
GeneralRe: Angular JS code Not work Pin
Nathan Minier16-Feb-17 6:33
professionalNathan Minier16-Feb-17 6:33 
GeneralRe: Angular JS code Not work Pin
Richard MacCutchan16-Feb-17 7:45
mveRichard MacCutchan16-Feb-17 7:45 
QuestionMvc Discussion forum Pin
pankajkrgupta24-Jan-17 18:51
pankajkrgupta24-Jan-17 18:51 
AnswerRe: Mvc Discussion forum Pin
Richard MacCutchan24-Jan-17 22:35
mveRichard MacCutchan24-Jan-17 22:35 
AnswerRe: Mvc Discussion forum Pin
ZurdoDev25-Jan-17 0:46
professionalZurdoDev25-Jan-17 0:46 
QuestionHow Do I Place Google Translate Correctly Pin
xiecsuk19-Jan-17 6:58
xiecsuk19-Jan-17 6:58 
AnswerRe: How Do I Place Google Translate Correctly Pin
Sushil viper 19-Jan-17 8:38
Sushil viper 19-Jan-17 8:38 
GeneralRe: How Do I Place Google Translate Correctly Pin
xiecsuk19-Jan-17 22:35
xiecsuk19-Jan-17 22:35 
GeneralRe: How Do I Place Google Translate Correctly Pin
Sushil viper 19-Jan-17 22:46
Sushil viper 19-Jan-17 22:46 
GeneralRe: How Do I Place Google Translate Correctly Pin
xiecsuk20-Jan-17 0:01
xiecsuk20-Jan-17 0:01 
QuestionWhy my fetch row method just repeats the first record multiple times (same count as my number of fields in the table) Pin
ELMAGLAYA17-Jan-17 17:07
ELMAGLAYA17-Jan-17 17:07 
AnswerRe: Why my fetch row method just repeats the first record multiple times (same count as my number of fields in the table) Pin
Ashwin. Shetty17-Jan-17 17:39
Ashwin. Shetty17-Jan-17 17:39 
GeneralRe: Why my fetch row method just repeats the first record multiple times (same count as my number of fields in the table) Pin
ELMAGLAYA17-Jan-17 17:41
ELMAGLAYA17-Jan-17 17:41 
GeneralRe: Why my fetch row method just repeats the first record multiple times (same count as my number of fields in the table) Pin
Ashwin. Shetty17-Jan-17 18:32
Ashwin. Shetty17-Jan-17 18:32 
GeneralRe: Why my fetch row method just repeats the first record multiple times (same count as my number of fields in the table) Pin
ELMAGLAYA17-Jan-17 19:33
ELMAGLAYA17-Jan-17 19:33 
AnswerRe: Why my fetch row method just repeats the first record multiple times (same count as my number of fields in the table) Pin
COBOLdinosaur27-Feb-17 8:33
COBOLdinosaur27-Feb-17 8:33 
QuestionI do not know why after entering the second number for the second time, it always gives the same result Pin
Member 1294604611-Jan-17 17:35
Member 1294604611-Jan-17 17:35 
AnswerRe: I do not know why after entering the second number for the second time, it always gives the same result Pin
ZurdoDev13-Jan-17 6:08
professionalZurdoDev13-Jan-17 6:08 
QuestionI do not know why after entering the second number for the second time, it always gives the same result Pin
Member 1294604611-Jan-17 17:35
Member 1294604611-Jan-17 17:35 
Buenas el caso es este:


[IMG]https://s27.postimg.org/4wo7d1e7n/ejer.png[/IMG]

code:[url]http://pastebin.com/tPN44966[/url]
[code]package practica;

public class adivinar2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int numeroAdivinar;
		int numeroComparar;
		 short contador;
		 int cifrasAdivinar= 0; 
		 int bandera=0;
		 int nDesAdivinar;
		 int nDesComparar;
		 int digitoAdivinar;
		 int digitoComparar;
		
		System.out.println("Introduzca el primer numero");
		numeroAdivinar=Leer.datoInt();
		
		for ( contador=1 ; contador<=10; contador++){
			
			
			
			System.out.println("Introduzca el segundo numero");
			numeroComparar=Leer.datoInt();
			
			if(numeroAdivinar==numeroComparar){
				
           	 contador=10;
           	 bandera=1;
           	 
            }else{
            	
            	nDesAdivinar=numeroAdivinar;
            	nDesComparar=numeroComparar;
            	
            	while(  nDesAdivinar!=0){   
				
            		nDesAdivinar = nDesAdivinar/10;
            				digitoAdivinar= nDesAdivinar%10; 
            		nDesComparar = nDesComparar/10;
            				digitoComparar=nDesComparar%10;
            		if(digitoAdivinar==digitoComparar){
            			cifrasAdivinar=cifrasAdivinar+1;
            		}
				      
            	}cifrasAdivinar=cifrasAdivinar-1;
            	System.out.println("Has introducido un total de: "+cifrasAdivinar+" dígitos");
		
		}
            	
		}
		if(bandera==1){
			System.out.println("Has acertado todas las cifras");
			
		}else{
			System.out.println("Se te acabaron las oportunidades");
		}
		}
			
		
         
        
       
          
	}
	[/code]

prblema:[spoiler][code]Introduzca el primer numero123
Introduzca el segundo numero
153
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
223
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
555
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
153
Has introducido un total de: 2 dígitos
Introduzca el segundo numero
123
Has acertado todas las cifras
[/code][/spoiler]




Parece que cuando vuelve a partir de la segunda vez, ya se desloquece


[spoiler][code]
Introduzca el primer numero
123456789
Introduzca el segundo numero
123456779
Has introducido un total de: 8 dígitos
Introduzca el segundo numero
123456779
Has introducido un total de: 8 dígitos
Introduzca el segundo numero
123456669
Has introducido un total de: 8 dígitos
Introduzca el segundo numero
123466669
Has introducido un total de: 8 dígitos
Introduzca el segundo numero[/code][/spoiler]

AnswerRe: I do not know why after entering the second number for the second time, it always gives the same result Pin
ZurdoDev13-Jan-17 6:08
professionalZurdoDev13-Jan-17 6:08 
QuestionHTML fo uploading image file Pin
FilippoCSM10-Jan-17 3:51
FilippoCSM10-Jan-17 3:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.