Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int i,j;
- float buildingEnergy[8][4],floorEnergy[8] = {0},secondColummnEnergy = 0;
- for (i = 0; i < 8; i++)
- {
- for (j = 0; j < 4; j++)
- {
- printf("Entre com o consumo medio do apartamento %d do %d andar:\n",j+1,i+1);
- scanf("%f",&buildingEnergy[i][j]);
- floorEnergy[i] += buildingEnergy[i][j];
- if (j == 1)
- secondColummnEnergy += buildingEnergy[i][j];
- }
- }
- printf("Consumo total dos apartamentos da segunda coluna : %.3f\n",secondColummnEnergy);
- for (i = 0; i < 8; i++)
- {
- printf("Consumo total do andar %d = %.3f\n",i+1,floorEnergy[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment