My issue
Why 336 is wrong answer for 3 digit??
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int ans = 3, t = 3;
int d;
cin>>d;
for(int i=1;i<d;i++){
ans*=10;
ans+=3;
}
if(ans%9==0){
cout<<ans+3<<endl;
}
else{
cout<<ans<<endl;
}
}
return 0;
}
Learning course: Jump from 2* to 3*
Problem Link: CodeChef: Practical coding for everyone