Advertisement
MeehoweCK

Untitled

Jul 6th, 2021
808
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczba = 10;        // zmienna typu int o wartości 10
  8.     cout << liczba << endl; // 10
  9.     liczba = 15;
  10.     cout << liczba << endl; // 15
  11.  
  12.     /* typy zmiennych:
  13.     bool - wartości logiczne (prawda i fałsz)
  14.     char - pojedynczy znak (litera, cyfra, znak interpunkcyjny itp.)
  15.     float, double - liczby zmiennoprzecinkowe
  16.     string - napisy (ciągi znaków)
  17.     */
  18.  
  19.     bool pf;
  20.     cout << pf << endl;
  21.     pf = true;
  22.     cout << pf << endl;     // 1
  23.  
  24.     char znak = 'h';
  25.     cout << znak << endl;
  26.  
  27.     float pi = 3.14159;
  28.     cout << pi << endl;
  29.  
  30.     string napis = "jakis napis";
  31.     cout << napis << endl;
  32.  
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement