Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int main(){
  5.     int n, i, d, maior=-1;
  6.        while( scanf("%d",&n) == 1 ){
  7.             for(i = 1; i<=n; i++){
  8.                 scanf("%d", &d);
  9.                     if( d > maior){
  10.                         maior = d;
  11.                     }
  12.             }
  13.                 if(maior < 10){
  14.                         printf("1\n");
  15.                 }
  16.                 if(maior >= 10 && maior < 20){
  17.                         printf("2\n");
  18.                 }
  19.                 else{
  20.                     printf("3\n");
  21.                 }
  22.                 maior = -1;
  23.        }
  24.  
  25.     return 0;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement