Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream f("conversie_b_10.in");
- ofstream g("conversie_b_10.out");
- int main()
- {
- int n,b,nr=0,p=1;
- f>>n>>b;
- while(n)
- nr+=n%10*p,p*=b,n/=10;
- g<<nr;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement