原题链接https://www.luogu.com.cn/problem/P8723
模拟
注意的是都要转换乘相应的进制
// dp练习
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#define ll long long
const ll N = 200;
ll n;
std::string check(ll aa){
std::string res = "";
while(aa){
ll jk = aa % n;
if(jk >= 10) res += (jk - 10 + 'A');
else res += std::to_string(jk);
aa /= n;
}
reverse(res.begin(),res.end());
// std::cout << res << " ";
return res;
}
void solve(){
// ll n;
std::cin >> n;
for(ll i = 1; i < n; i ++){
for(ll j = 1; j <= i; j ++){
ll re = i * j;
std::string j1 = check(i);
std::string j2 = check(j);
std::string jj = check(re);
std::cout << j1 << "*" << j2 << "=" << jj;
if(j != i) std::cout << " ";
}
if(i != n - 1)
std::cout << "\n";
}
}
int main(){
ll t = 1;
while(t --)
solve();
return 0;
}