Advertisement
wiktormadera

Sprawdzian

Nov 20th, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. Zad1
  2.  
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     int x = 25;
  10.     int *wsk_x = &x;
  11.     *wsk_x = x*10;
  12.     cout<<*wsk_x;
  13.  
  14.     return 0;
  15. }
  16.  
  17. Zad2
  18.  
  19. #include <iostream>
  20.  
  21. using namespace std;
  22.  
  23. struct Posciel
  24. {
  25.     float szerokosc, dlugosc;
  26.     string kolor, producent;
  27.     int cena;
  28. };
  29.  
  30. int main()
  31. {
  32.     Posciel posciel;
  33.     posciel.cena = 20;
  34.     posciel.dlugosc = 12.5;
  35.     posciel.szerokosc = 5.5;
  36.     posciel.kolor = "czerwony";
  37.     posciel.producent = "giorgio armani";
  38.     cout << "Cena: " << posciel.cena<<endl;
  39.     cout << "Dlugosc: " << posciel.dlugosc<<endl;
  40.     cout << "Szerokosc: " << posciel.szerokosc<<endl;
  41.     cout << "Kolor: " << posciel.kolor<<endl;
  42.     cout << "Producent: " << posciel.producent<<endl;
  43.  
  44.     return 0;
  45. }
  46.  
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement