wiktortokumpel

Untitled

Jan 27th, 2023
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. using namespace std;
  5.  
  6. basic_string<char> liczba_na_napis(int liczba){
  7. string napis = "";
  8. while (liczba > 0) {
  9. char c = (liczba % 10) + '0';
  10.  
  11.  
  12. napis += c;
  13. liczba /= 10;
  14. }
  15.  
  16.  
  17. return napis;
  18. }
  19.  
  20. int main(){
  21.  
  22. int number = 12345;
  23.  
  24. cout << liczba_na_napis(number);
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment