Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- //zadanie 1
- //a)
- int x=25;
- //b)
- int *wsk_x=&x;
- //c)
- *wsk_x=x*10;
- //d)
- cout<<*wsk_x<<endl;
- //zadanie 2
- //a)
- struct Posciel {
- float szerokosc1;
- float dlugosc1;
- string kolor1;
- int cena1;
- string producent1;
- };
- //b)
- float szerokosc1=2.50;
- float dlugosc1=2.20;
- string kolor1="czerwony";
- int cena1=120;
- string producent1="fajna-posciel";
- //c)
- cout<<"Oto nasza posciel o szerokosci "<<szerokosc1<<"m, dlugosci "<<dlugosc1<<"m, producenta '"<<producent1<<"', koloru: "<<kolor1<<" juz teraz w cenie "<<cena1<<" zlotych!!"<<endl;
- //zadanie 3
- //a)
- class posciel
- {
- public:
- float szerokosc2;
- float dlugosc2;
- string kolor2;
- int cena2;
- string producent2;
- //b)
- float szerokosc=3.20;
- float dlugosc=3.10;
- string kolor="zielony";
- int cena=180;
- string producent="lepsza-posciel";
- //c)
- void wyswietl ()
- {
- cout<<"Oto nasza posciel o szerokosci "<<szerokosc2<<"m, dlugosci "<<dlugosc2<<"m, producenta '"<<producent2<<"', koloru: "<<kolor2<<" juz teraz w cenie "<<cena2<<" zlotych!!"<<endl;
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement