Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #define individual 2
- #define coletivo 2
- struct apartamento{
- int num,carro;
- float custoI;
- };
- struct predio{
- struct apartamento ap[individual];
- int aguaP,luzP,salP,custoP;
- };
- struct condominio{
- struct predio bl[coletivo];
- float aguaC,luzC,salC,Acomum,custoC;
- };
- void cadastrarCC(struct condominio *valorC){
- int i;
- printf("INFORME O VALOR DA AGUA DO CONDOMINIO: ");
- scanf("%f", &valorC[i].aguaC);
- printf("INFORME O VALOR DA LUZ DO CONDOMINIO: ");
- scanf("%f", &valorC[i].luzC);
- printf("INFORME O VALOR DO SALARIO DOS FUNCIONARIOS DO CONDOMINIO: ");
- scanf("%f", &valorC[i].salC);
- printf("INFORME O VALOR DOS CUSTOS DA AREA COMUM DO CONDOMINIO: "); //comum inclui todas as despesas geradas pelas àreas coletivas do condomínio (exceto água, luz e salários)
- scanf("%f", &valorC[i].Acomum);
- }
- void cadastrarCP(struct predio *valorP){
- int i;
- for(i=0; i<coletivo; i++){
- printf("INFORME O VALOR DA AGUA DO PREDIO %i: ",i+1);
- scanf("%f", &valorP[i].aguaP);
- printf("INFORME O VALOR DA LUZ DO PREDIO %i: " ,i+1);
- scanf("%f", &valorP[i].luzP);
- printf("INFORME O VALOR DO SALARIO DOS FUNCIONARIOS DO PREDIO %i: " ,i+1);
- scanf("%f", &valorP[i].salP);
- }
- }
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- /*void mostrar(struct condominio *valorC){
- int i;
- printf("O VALOR DA AGUA DO CONDOMINIO eh: %.2f \n",valorC[i].aguaC);
- }*/
- int main(int argc, char *argv[]) {
- struct condominio riopedras[coletivo];
- struct predio bloco[coletivo];
- system("COLOR F0");
- cadastrarCC(&riopedras);
- system("cls");
- cadastrarCP(&bloco);
- //system("cls");
- //mostrar(riopedras);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement