intuition: how i this wrong i am not understanding, logic : all the multiples of 9 have the sum of each digit as multiple of 9: 9, 18 = 9, 27 = 19, 99 = 18, 9*1342575 = 12083175 = 27
my code:
void solve()
{
int n;
cin>>n;
string ans = “”;
int sm = 0;
while(n--)
{
ans += ‘3’;
sm += 3;
}
if(sm%9 == 0)
{
ans.pop_back();
ans += ‘0’;
}
cout<<ans<<endl;
}