Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- string koral(int k){
- if(k==0){
- return "";
- }else{
- if(k%2==0){
- koral(k/2);
- return +"b";
- }else{
- koral(k/2);
- return +"c";
- }
- }
- }
- int main(){
- int k;
- cout <<"Podaj liczbe korali: ";
- cin >> k;
- cout << koral(k);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement