

Hãy luôn nhớ cảm ơn và vote 5*
nếu câu trả lời hữu ích nhé!
// Ảnh kq full k che
#include <bits/stdc++.h>
using namespace std;
void _print(int ar[1000]){
int i, j ;
for (i=999;i>=0;i--) if (ar[i]!=0) break ;
for (j=i;j>=0;j--) cout << ar[j];
}
void _pow(int a, int n)
{
int ar[1000]={0}, i, j, k, d = 0 ;
ar[0] = 1 ;
if (n>=0)
{
for (i=0;i<n;i++){
for (j=0;j<999;j++){
k = (ar[j]*a+d)/10 ;
if ((ar[j]*a+d)>=10)
{
ar[j] = (ar[j]*a+d) % 10 ;
d = k ;
}
else
{
ar[j] = (ar[j]*a+d) % 10 ;
d = 0 ;
}
}
}
_print(ar);
}
else {cout << "1/"; _print(ar);};
}
int main(){
int a, n ;
cin >> a >> n ;
_pow(a,n);
}
// $\color{#00FF00}{\texttt{#Khoadang09}}$
Hãy giúp mọi người biết câu trả lời này thế nào?
![]()
#include <bits/stdc++.h>
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MOD 1000000007LL
#define MOD2 998244353LL
#define endl '\n'
#define INFINITE 2147483647LL
#define INFINITE2 9223372036854775807
#define llll pair<ll,ll>
#define ldld pair<ld,ld>
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using namespace std;
string mul(string a,ll b)
{
ll temp=0;
string ans="";
for(int i=a.size()-1;i>=0;i--)
{
ll s=(a[i]-'0')*b+temp;
temp=s/10;
s%=10;
ans=(char)(s+48)+ans;
}
while(temp)
{
ans=(char)(temp%10+48)+ans;
temp/=10;
}
return ans;
}
void solve()
{
string ans;
ll a,b;
cin >> a >> b;
ans=to_string(a);
for(int i=2;i<=b;i++)
{
ans=mul(ans,a);
}
cout << ans << endl;
}
int main()
{
fastIO
ll t=1;
while(t--)
solve();
return 0;
}
Hãy giúp mọi người biết câu trả lời này thế nào?
Bảng tin
42
373
10
https://hoidap247.com/cau-hoi/6005571 giúp t với ạ
42
373
10
https://hoidap247.com/cau-hoi/6006505 giúp t với ạ