#include <iostream> #include <string> #include <iomanip> #include <cmath> using namespace std; void toBase (float n, float base) { string x = "0123456789ABCDEF"; if (n > 0) { toBase(n / base, base); cout << x[n % base]; } } main() { int a; float num; cout << ""; cin >> num; cout << ""; cin >> a; toBase(num, a); }
n
x
string x
int
long
%
fmod
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)