Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define MAX_TEMB 20 //cantidad maxima de temblores por dia
- #define MAX_MAG 11 //maxima magnitud
- int main(void){
- int i,j,mayor_mag=-999;
- int cant_temblores[30],magnitud_temblores[MAX_TEMB];
- float max_magnitud;
- printf("Ingrese la cantidad de temblores para cada día\n");
- for(i=0;i<30;i++){
- do{
- printf("\nDia %i, cantidad de temblores\t:",i+1);
- scanf("%i",&cant_temblores[i]);
- }while(cant_temblores[i] > MAX_TEMB );
- for(j=0;j<cant_temblores[i];j++){
- do{
- printf("magnitud temblor %i\t:",j+1);
- scanf("%i",&magnitud_temblores[j]);
- if(mayor_mag < magnitud_temblores[j]){
- mayor_mag = magnitud_temblores[j];
- }
- }while(magnitud_temblores[j] > MAX_MAG );
- }
- }
- printf("Maxima magnitud: %i",mayor_mag);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement