Advertisement
Avdluna

OLHAQ

Nov 9th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.    
  6.     while(1){
  7.     int n,i;
  8.     scanf("%d",&n);
  9.         if(n==0)break;
  10.         else{
  11.             int bilhetes[n],pos[n];
  12.                 for(i=0;i<n;i++){
  13.                     scanf("%d",&bilhetes[i]);
  14.                     bilhetes[i]=pos[n];
  15.                 }
  16.                
  17.                 sort(bilhetes.begin(),bilhetes.end());
  18.                 int ganhador;
  19.                 for(i=0;i<n;i++){
  20.                     if(bilhetes[i]==pos[i]);
  21.                       ganhador=pos[i];
  22.                       int c=1;
  23.                      
  24.                      printf("Teste %d\n%d\n",c,ganhador);
  25.                      c++;
  26.                 }
  27.         }
  28.     }
  29.  
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement