C_plus_plus_12345 @ 2024-11-26 21:55:50
#include<iostream>
using namespace std;
void TurnData(int n, int a);
unsigned long long V;
int f;
char ttfif[90] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd',
'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', '@', '_', '+', '!', '#', '{', '}', '"',
':', ';', '%', '^', '&', '*', '[', ']', '(', ')',
'\\', '`', '~', '\'', '=', '<', '>', ',', '.', '?',
'/', '\xa2', '\xa5', '\xb1', '\xac', '\xb7', '\xa9', '\xd7', '\xf7', '\xa7'};
int main()
{
cin >> V >> f;
TurnData(V, f);
return 0;
}
void TurnData(int n, int a)
{
int x[17], i, j, k = 0;
if (n < 0)
{
cout << "-";
}
j = abs(n);
do
{
k++;
i = j % a;
j /= a;
x[k] = i;
}
while (j != 0);
for (int h = k; h >= 1; --h)
{
if (x[h] < 10)
{
cout << x[h];
}
else
{
cout << ttfif[x[h] - 10];
}
}
cout << endl;
}
by JimmyQ @ 2024-11-26 21:57:31
好活
by litianrui0201 @ 2024-12-05 17:21:23
@C_plus_plus_12345我的是你的简写char可以改string