Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.85 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #define MAX_TEMB 20  //cantidad maxima de temblores por dia
  4. #define MAX_MAG 11   //maxima magnitud
  5.  
  6. int main(void){
  7.    int i,j,mayor_mag=-999;
  8.    int cant_temblores[30],magnitud_temblores[MAX_TEMB];
  9.    float max_magnitud;
  10.  
  11.    printf("Ingrese la cantidad de temblores para cada día\n");
  12.    for(i=0;i<30;i++){
  13.       do{
  14.          printf("\nDia %i, cantidad de temblores\t:",i+1);
  15.          scanf("%i",&cant_temblores[i]);
  16.       }while(cant_temblores[i] > MAX_TEMB );
  17.       for(j=0;j<cant_temblores[i];j++){
  18.      do{
  19.         printf("magnitud temblor %i\t:",j+1);
  20.         scanf("%i",&magnitud_temblores[j]);
  21.         if(mayor_mag < magnitud_temblores[j]){
  22.                mayor_mag = magnitud_temblores[j];
  23.         }
  24.          }while(magnitud_temblores[j] > MAX_MAG );
  25.       }
  26.    }
  27.    
  28.    printf("Maxima magnitud: %i",mayor_mag);
  29.  
  30.    return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement