SHARE
TWEET

Untitled

jpvieiraa Oct 21st, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(){
  4.     int i,n,maior,menor,a,b,c,e;
  5.     maior=-9999;
  6.     menor=9999;
  7.     scanf("%d",&n);
  8.     int v[n];
  9.     for(i=0;i<n;i++)
  10.         scanf("%d",&v[i]);
  11.     for(i=0;i<n;i++){
  12.         if(v[i]>maior){
  13.             maior=v[i];
  14.             a=i;
  15.         }
  16.         if(v[i]<menor){
  17.             menor=v[i];
  18.             b=i;
  19.         }
  20.     }
  21.     printf("%d (%d)\n",maior,a);
  22.     printf("%d (%d)\n",menor,b);
  23.     e=n-(n%2);
  24.     if(v[e]%2==0)
  25.         printf("PAR\n");
  26.     else
  27.         printf("IMPAR\n");
  28.    
  29.    
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top