Advertisement
iepsen

Untitled

Apr 30th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3.     int premio_caso, caso_testes, nro_agricultores,i = 0, j = 0, tamanho_fazenda, numero_anim,beneficio_amb;
  4.    
  5.     scanf("%d\n",&caso_testes);
  6.     for(i=0;i < caso_testes;i++){
  7.         scanf("%d", &nro_agricultores);
  8.         premio_caso = 0;
  9.             for(j=0;j < nro_agricultores;j++){
  10.                 scanf("%d", &tamanho_fazenda);
  11.                 scanf("%d", &numero_anim);
  12.                 scanf("%d", &beneficio_amb);
  13.                 premio_caso += tamanho_fazenda * beneficio_amb;        
  14.             }
  15.                 printf("%d\n", premio_caso);
  16.     }
  17.            
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement