Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- string zamiana(int a,int p)
- {
- string wynik="";
- int reszta=0;
- if(reszta==10)
- wynik='A'+wynik;
- else if(reszta==11)
- wynik='B'+wynik;
- else if(reszta==12)
- wynik='C'+wynik;
- else if(reszta==13)
- wynik='D'+wynik;
- else if(reszta==14)
- wynik='E'+wynik;
- else if(reszta==15)
- wynik='F'+wynik;
- else
- wynik=(char) (a%p+48)+wynik;
- a=a/p;
- } return wynik;
- }
- int main()
- {
- cout<<zamiana(67,2)<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement