14.01.2013 Views

Soluciones y Explicación de los problemas ACM ... - ICPC Bolivia

Soluciones y Explicación de los problemas ACM ... - ICPC Bolivia

Soluciones y Explicación de los problemas ACM ... - ICPC Bolivia

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Explicaciones a <strong>los</strong> <strong>problemas</strong> South American Regionals 2008 64<br />

}<br />

printf("%d\n",sw+1);<br />

//primera vez, se verifica si ya no tiene<br />

return; //cartas, si es asi, imprime y termina<br />

}<br />

}else{ //si el jugador actual perdio su turno<br />

if(actual.second==1){//as hace que saque una carte<br />

aux=mazo.front();<br />

mazo.pop();<br />

insertar_carta(&jugadores[sw],aux.first,aux.second);<br />

}else if(actual.second==7){//siete hace que saque dos cartas<br />

aux=mazo.front();<br />

mazo.pop();<br />

insertar_carta(&jugadores[sw],aux.first,aux.second);<br />

aux=mazo.front();<br />

mazo.pop();<br />

insertar_carta(&jugadores[sw],aux.first,aux.second);<br />

}<br />

perdio_su_turno=false;<br />

}<br />

sw+=direccion;//pasando al siguiente jugador<br />

if(sw=p)sw=0;<br />

}<br />

int main(){<br />

while(scanf("%d %d %d",&p,&m,&n)&&(p||m||n))resuelva();<br />

}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!