Difference between revisions of "Solução: Quermesse - OBI (Paulo Cesar)"
From AdonaiMedrado.Pro.Br
(New page: <code lang="c"> #include<stdio.h> #define MAX_SIZE 10000 int main() { int size, cont, num, cont_test; size = 1; cont_test = 1; while( size > 0 && size <= MAX_SIZE ) { scan...) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<code lang="c"> | <code lang="c"> | ||
#include<stdio.h> | #include<stdio.h> | ||
− | + | ||
− | + | ||
− | + | ||
int main() | int main() | ||
{ | { | ||
Line 9: | Line 7: | ||
size = 1; | size = 1; | ||
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); | ||
Line 21: | Line 19: | ||
cont_test++; | cont_test++; | ||
} | } | ||
− | + | ||
return 0; | return 0; | ||
} | } | ||
</code> | </code> |
Latest revision as of 13:44, 1 April 2009
#include<stdio.h> 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); } cont_test++; } return 0; }