Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define ANDARES 8
- #define APTOS 4
- int main() {
- float consumo[ANDARES][APTOS];
- int l,c;
- for(l=0; l<ANDARES; l++) {
- for(c=0; c<APTOS; c++) {
- printf("Entre consumo do andar %d e apto %d:", l+1, c+1);
- scanf("%f", &consumo[l][c]);
- }
- }
- float soma = 0;
- for(l=0; l<ANDARES; l++) {
- soma = soma + consumo[l][1];
- }
- printf("Consumo total dos aptos da coluna 2: %f", soma);
- float soma2 = 0;
- for(c=0; c<APTOS; c++) {
- soma2 += consumo[4][c];
- }
- printf("Consumo total dos aptos do andar 5: %f", soma2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement