Odpowiedź :
Odpowiedź:
a)
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
int a, base = 0;
cout << "Podaj dlugosc podstawy choinki: ";
cin >> a;
while (a!=0){
base++;
for (int i = 0; i<a;i++){
cout << " ";
}
for(int i = 0; i<base;i++){
cout<<"*";
}
cout<<endl;
a--;
}
return 0;
}
b)
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
float a, b;
float x =0.f;
cout <<"Podaj liczbe a: ";
cin >> a;
cout <<"Podaj liczbe b: ";
cin >>b;
cout<<a<<"x + "<<b<<" = 0"<<endl;
x = -b/a;
cout<<"x = "<<x;
return 0;
}
![Zobacz obrazek Anckpop](https://pl-static.z-dn.net/files/d24/663203ca3ef274e62893d2681b7dc5e0.jpg)
![Zobacz obrazek Anckpop](https://pl-static.z-dn.net/files/da2/23fa3fad9ec4b27e6e40e451a1dbdd4c.jpg)