Difference between revisions of "Solução: Quermesse - OBI (Paulo Cesar)"
From AdonaiMedrado.Pro.Br
Line 10: | Line 10: | ||
cont_test = 1; | cont_test = 1; | ||
− | while( size > 0 | + | while( size > 0 ) |
{ | { | ||
scanf("%d",&size); | scanf("%d",&size); | ||
− | for( cont = 0; | + | for( cont = 0; size > 0, cont < size; cont++) |
{ | { | ||
scanf("%d",&num); | scanf("%d",&num); |
Revision as of 13:06, 1 April 2009
#include<stdio.h> #define MAX_SIZE 10000 int main() { int size, cont, num, cont_test; size = 1; cont_test = 1; while( size > 0 ) { scanf("%d",&size); for( cont = 0; size > 0, cont < size; cont++) { scanf("%d",&num); if( num == cont+1 ) { printf("Teste %d\n%d\n\n",cont_test,num); break; } } cont_test++; } return 0; }