Ver Mensaje Individual
  #6 (permalink)  
Antiguo 22/11/2015, 17:02
Avatar de mortiprogramador
mortiprogramador
Colaborador
 
Fecha de Ingreso: septiembre-2009
Ubicación: mortuoria
Mensajes: 3.805
Antigüedad: 14 años, 8 meses
Puntos: 214
Respuesta: Dificil Logica de programacion como hago?

Saludo.
Pues sí, ya con la explicación sobre este me quedó más claro.

En cuanto al ejemplo ya modificado por tu parte, hasta el F quedé bien,
pero en E dices

Cita:
Iniciado por JoseGMariani Ver Mensaje
PP de E son 20

Predecesor (F) con PP 10 (No suma para sus hijos por que tiene PT=100>=100.)
Predecesor (G) con PP 20
Predecesor (H) con PP 80 (No suma para sus hijos por que tiene PT=150>=100.)
Predecesor (I) con PP 40

Sus PG suman 40+20=60 => PT son 60(PG)+20(PP)=80

Nota este usuario no tiene a J ya que a pesar de que es un Hijo,
para los calculos de PG solo se toman en cuenta hasta el 5to nivel.



¿Por qué no entra J, no sería este el 5 nivel? Sí se omite J, serían solo 4 niveles.

Obviamente de aquí para abajo cambia precisamente por omitir a J para E
respecto al ejercicio inicial.

Pero con lo que explicas (Exceptuando la pregunta que hago),
entonces yo lo vería así:

PP de J son 30
Sus PG suman 0 y los PT son 30
******************************************

PP de I son 40
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 30 y los PT son 70
******************************************

PP de H son 80
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 70 y los PT son 150
******************************************

PP de G son 20
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 70 y los PT son 90
******************************************

PP de F son 10
Predecesores (G) con PT 20. Hereda al tener solo 90 PT.
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 90 y los PT son 100
******************************************

PP de E son 20
Predecesores (F) con PT 10. NO hereda al tener 100 PT.
Predecesores (G) con PT 20. Hereda al tener solo 90 PT.
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 90 y los PT son 110
******************************************

PP de D son 50
Predecesores (E) con PT 20. NO hereda al tener 110 PT.
Predecesores (F) con PT 10. NO hereda al tener 100 PT.
Predecesores (G) con PT 20. Hereda al tener solo 90 PT.
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Sus PG suman 60 y los PT son 110
******************************************

PP de C son 70
Predecesores (D) con PT 50. NO hereda al tener 110 PT.
Predecesores (E) con PT 20. NO hereda al tener 110 PT.
Predecesores (F) con PT 10. NO hereda al tener 100 PT.
Predecesores (G) con PT 20. Hereda al tener solo 90 PT.
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Sus PG suman 20 y los PT son 90
******************************************

PP de B son 10
Predecesores (C) con PT 70. Hereda al tener solo 90 PT.
Predecesores (D) con PT 50. NO hereda al tener 110 PT.
Predecesores (E) con PT 20. NO hereda al tener 110 PT.
Predecesores (F) con PT 10. NO hereda al tener 100 PT.
Predecesores (G) con PT 20. Hereda al tener solo 90 PT.
Sus PG suman 90 y los PT son 100
******************************************

PP de A son 70
Predecesores (B) con PT 10. NO hereda al tener 100 PT.
Predecesores (C) con PT 70. Hereda al tener solo 90 PT.
Predecesores (D) con PT 50. NO hereda al tener 110 PT.
Predecesores (E) con PT 20. NO hereda al tener 110 PT.
Predecesores (F) con PT 10. NO hereda al tener 100 PT.
Sus PG suman 70 y los PT son 140
******************************************

Y sí luego, por ej, el usuario G obtiene otros 20 PP (40 en total) entonces


PP de J son 30
Sus PG suman 0 y los PT son 30
******************************************

PP de I son 40
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 30 y los PT son 70
******************************************

PP de H son 80
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 70 y los PT son 150
******************************************

PP de G son 40
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 70 y los PT son 110
******************************************

PP de F son 10
Predecesores (G) con PT 40. NO hereda al tener 110 PT.
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 70 y los PT son 80
******************************************

PP de E son 20
Predecesores (F) con PT 10. Hereda al tener solo 80 PT.
Predecesores (G) con PT 40. NO hereda al tener 110 PT.
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Predecesores (J) con PT 30. Hereda al tener solo 30 PT.
Sus PG suman 80 y los PT son 100
******************************************

PP de D son 50
Predecesores (E) con PT 20. NO hereda al tener 100 PT.
Predecesores (F) con PT 10. Hereda al tener solo 80 PT.
Predecesores (G) con PT 40. NO hereda al tener 110 PT.
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Predecesores (I) con PT 40. Hereda al tener solo 70 PT.
Sus PG suman 50 y los PT son 100
******************************************

PP de C son 70
Predecesores (D) con PT 50. NO hereda al tener 100 PT.
Predecesores (E) con PT 20. NO hereda al tener 100 PT.
Predecesores (F) con PT 10. Hereda al tener solo 80 PT.
Predecesores (G) con PT 40. NO hereda al tener 110 PT.
Predecesores (H) con PT 80. NO hereda al tener 150 PT.
Sus PG suman 10 y los PT son 80
******************************************

PP de B son 10
Predecesores (C) con PT 70. Hereda al tener solo 80 PT.
Predecesores (D) con PT 50. NO hereda al tener 100 PT.
Predecesores (E) con PT 20. NO hereda al tener 100 PT.
Predecesores (F) con PT 10. Hereda al tener solo 80 PT.
Predecesores (G) con PT 40. NO hereda al tener 110 PT.
Sus PG suman 80 y los PT son 90
******************************************

PP de A son 70
Predecesores (B) con PT 10. Hereda al tener solo 90 PT.
Predecesores (C) con PT 70. Hereda al tener solo 80 PT.
Predecesores (D) con PT 50. NO hereda al tener 100 PT.
Predecesores (E) con PT 20. NO hereda al tener 100 PT.
Predecesores (F) con PT 10. Hereda al tener solo 80 PT.
Sus PG suman 90 y los PT son 160
******************************************

__________________
"Si consigues ser algo más que un hombre, si te entregas a un ideal, si nadie puede detenerte, te conviertes en algo muy diferente."
Visita piggypon.com

Última edición por mortiprogramador; 22/11/2015 a las 17:27