Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- while(1){
- int n,i;
- scanf("%d",&n);
- if(n==0){
- break;
- }
- else{
- int bilhetes[n],pos[n];
- for(i=1;i<n+1;i++){
- scanf("%d",&bilhetes[i]);
- bilhetes[i]=pos[i];
- }
- sort(bilhetes,bilhetes+n);
- int ganhador;
- for(i=1;i<n+1;i++){
- if(bilhetes[i]==pos[i]);
- ganhador=pos[i];
- }
- int c=1;
- printf("Teste %d\n%d\n\n",c,ganhador);
- c++;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement