Solução: Quermesse - OBI (Paulo Cesar)

From AdonaiMedrado.Pro.Br
Revision as of 12:47, 1 April 2009 by 200.17.147.2 (Talk) (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...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#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 )
  {
    scanf("%d",&size);
    for( cont = 0; (size > 0 && size <= MAX_SIZE), cont < size; cont++)
    {
      scanf("%d",&num);
      if( num == cont+1 )
        printf("Teste %d\n%d\n\n",cont_test,num);
    }
    cont_test++;
  }
 
  return 0;
}