vreau sa calculez media cu teza dar in loc sa imi arate doar ce cere if-ul imi arata la toate restul ,adica daca dau e =3 (eu avand if(e=3){coamnda }si if (e=4){alta comanda }) imi executa comada de la 3 si 4 ,dc?
#include
#include
using namespace std;
int a,b,c,d,e,t,suma1,suma2,p2,p1,p3,g1,suma3,z;
int main()
{ double p3,suma2,suma3;
cout<<"Cate note ai fara teza ";cin>>e;
if(e>6)
{
cout<<"in locru....";
}
cout<
if(e=3)
{cout<<"prima nota=";cin>>a;
cout<<"a doua nota=";cin>>b;
cout<<"a treia nota=";cin>>c;
cout<<"teza=";cin>>t;
suma1=a+b+c;
p2=suma1+t;
p3=p2/4;
cout<
}
if(e=4)
{cout<<"prima nota=";cin>>a;
cout<<"a doua nota=";cin>>b;
cout<<"a treia nota=";cin>>c;
cout<<"a patra nota=";cin>>d;
cout<<"teza=";cin>>t;
suma2=((a+b+c+d)/4*3+t)/4;
cout<
}
if(e=5 )
{cout<<"prima nota=";cin>>a;
cout<<"a doua nota=";cin>>b;
cout<<"a treia nota=";cin>>c;
cout<<"a patra nota=";cin>>d;
cout<<"a cincea nota=";cin>>z;
cout<<"teza=";cin>>t;