Advertisement
MeehoweCK

Untitled

Jan 25th, 2024
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. void sortuj(std::vector<short int>& cyfry) {
  5.     auto n{ cyfry.size() };
  6.     for (short int i = 0; i < n - 1; ++i) {
  7.         for (short int j = 0; j < n - i - 1; ++j) {
  8.             if (cyfry[j] > cyfry[j + 1]) {
  9.                 std::swap(cyfry[j], cyfry[j + 1]);
  10.             }
  11.         }
  12.     }
  13. }
  14.  
  15. std::vector<short int> wygeneruj_pierwszy_ciag(int liczba) {
  16.     std::vector<short int> wynik{};
  17.     while (liczba > 0) {
  18.         wynik.push_back(liczba % 10);
  19.         liczba /= 10;
  20.     }
  21.     sortuj(wynik);
  22.     return wynik;
  23. }
  24.  
  25. unsigned long long wygeneruj_liczbe_z_ciagu(const std::vector<short int>& ciag) {
  26.    
  27. }
  28.  
  29. int main() {
  30.     unsigned long long a;
  31.     int b;
  32.     std::cout << "Podaj dwie liczby calkowite (oddzielone spacja): ";
  33.     std::cin >> a >> b;
  34.  
  35.     return 0;
  36. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement