You are on page 1of 1

#include<iostream>

#include<string>
using namespace std;
struct bophan{
double huong;
};
struct doanhthu{
bophan quy1,quy2,quy3,quy4 ,tongso ,tb;
};
int main(){
cout <<"kkkkk--------------------------------kkkkk\n";
doanhthu *n;
doanhthu p;
n = &p; int m;
cin >> m;
n = new doanhthu[m];
for (int i = 0; i < m; i++){
if (i == 0){
cout << "---mo nhap doanh thu dong---" << endl;
cout << "nhap lan luot tung quy : ";
}
if (i == 1){
cout << "---mo nhap doanh thu tay---" << endl;
cout << "nhap lan luot tung quy : ";
}
cin >> n[i].quy1.huong >> n[i].quy2.huong >> n[i].quy3.huong >>
n[i].quy4.huong;
}
for (int o = 0; o < m; o++){
n[o].tongso.huong = n[o].quy1.huong+ n[o].quy2.huong+ n[o].quy3.huong +
n[o].quy4.huong;
n[o].tb.huong = n[o].tongso.huong / 4.0;
}
for (int i = 0; i <m; i++){
cout << "tong doanh so ban hang dong : " << n[i].tongso.huong << endl;;
cout << "trung binh quy dong : " << n[i].tb.huong << endl;;
}
system("pause");
return 0;
}

You might also like