Submission
Status:
PPPPPPP-P
Subtask/Task Score:
96/100
Score: 96
User: .n0t_gloomy.
Problemset: บวกเลขฐาน
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-12 20:31:16
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int base;
cin>>base;
string s1,s2;
cin>>s1>>s2;
int x1,x2;
x1 = stoll(s1,NULL,base);
x2 = stoll(s2,NULL,base);
x1 += x2;
string ans = "";
while (x1 != 0)
{
int r = x1 % base;
if (r >= 10)
{
ans = char(55+r) + ans;
}
else ans = to_string(r) + ans;
x1 /= base;
}
cout<<ans<<"\n";
return 0;
}