Click here to Skip to main content
15,887,135 members
Home / Discussions / Web Development
   

Web Development

 
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 
AnswerRe: HTML fo uploading image file Pin
Nathan Minier10-Jan-17 6:43
professionalNathan Minier10-Jan-17 6:43 
GeneralRe: HTML fo uploading image file Pin
FilippoCSM10-Jan-17 9:20
FilippoCSM10-Jan-17 9:20 
QuestionWCF Service consumed through browser but NOT with WCFClient Pin
MrKBA5-Jan-17 20:17
MrKBA5-Jan-17 20:17 
AnswerRe: WCF Service consumed through browser but NOT with WCFClient Pin
Nathan Minier6-Jan-17 1:25
professionalNathan Minier6-Jan-17 1:25 
GeneralRe: WCF Service consumed through browser but NOT with WCFClient Pin
MrKBA6-Jan-17 1:57
MrKBA6-Jan-17 1:57 
GeneralRe: WCF Service consumed through browser but NOT with WCFClient Pin
Nathan Minier6-Jan-17 3:50
professionalNathan Minier6-Jan-17 3:50 
GeneralRe: WCF Service consumed through browser but NOT with WCFClient Pin
MrKBA6-Jan-17 4:45
MrKBA6-Jan-17 4:45 
QuestionSignalR on IIS Not Working Pin
Kevin Marois5-Jan-17 13:08
professionalKevin Marois5-Jan-17 13:08 
AnswerRe: SignalR on IIS Not Working Pin
ZurdoDev6-Jan-17 5:50
professionalZurdoDev6-Jan-17 5:50 
GeneralRe: SignalR on IIS Not Working Pin
Kevin Marois6-Jan-17 5:51
professionalKevin Marois6-Jan-17 5:51 
GeneralRe: SignalR on IIS Not Working Pin
ZurdoDev6-Jan-17 5:54
professionalZurdoDev6-Jan-17 5:54 
GeneralRe: SignalR on IIS Not Working Pin
Kevin Marois6-Jan-17 6:04
professionalKevin Marois6-Jan-17 6:04 
GeneralRe: SignalR on IIS Not Working Pin
ZurdoDev6-Jan-17 6:57
professionalZurdoDev6-Jan-17 6:57 
GeneralRe: SignalR on IIS Not Working Pin
Kevin Marois6-Jan-17 6:05
professionalKevin Marois6-Jan-17 6:05 
QuestionRe: SignalR on IIS Not Working Pin
ZurdoDev6-Jan-17 6:58
professionalZurdoDev6-Jan-17 6:58 

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.