Advertisement
MeehoweCK

Untitled

May 22nd, 2024
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5. int main() {
  6.     std::vector<int> wektor{ 1, 2, 3, 4, 5 };
  7.  
  8.     //for (auto i{ wektor.begin() }; i != wektor.end(); ++i) {  // for (auto i : wektor)
  9.     //  std::cout << *i << std::endl;
  10.     //}
  11.  
  12.     /*auto wypisanie{ [](int x) {std::cout << x << std::endl; } };
  13.     std::for_each(wektor.begin(), wektor.end(), wypisanie);*/
  14.  
  15.     auto x{ 3 };
  16.     if (x == 3) {
  17.         std::cout << "trzy\n";
  18.     }
  19.     else {
  20.         std::cout << "inna liczba\n";
  21.     }
  22.  
  23.     std::cout << (x == 3 ? "trzy" : "inna liczba") << std::endl;
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement