#include struct Oferta { int nr_oferta; char sector; int nr_odai; float pret; }; int main() { struct Oferta oferte[10]; int numar_oferte; int procent = 0; printf("Introdu numarul total de oferte: "); scanf("%d", &numar_oferte); for(int i = 0; i < numar_oferte; i++) { puts("Introdu numarul ofertei:"); scanf("%d", &oferte[i].nr_oferta); puts("Introdu sectorul:"); scanf(" %c", &oferte[i].sector); puts("Introdu numarul de odai:"); scanf("%d", &oferte[i].nr_odai); puts("Introdu pretul:"); scanf("%f", &oferte[i].pret); } for(int i = 0; i < numar_oferte; i++) { if(oferte[i].nr_odai == 2) { procent++; } } printf("Procentul locuintelor cu 2 odai: %.2f%%\n", (float)procent / numar_oferte * 100); return 0; }