Ideal Number

**Problem :**CodeChef: Practical coding for everyone
Difficulty : easy
Explanation : Let’s use brute force the find the answer.
You may find the answer is not too large (i.e. not bigger than 2*10^7), then you
can find it in the given time limit.
You can check every possible answer from 1 (or from 19), until we find the k-th
perfect integer.
That’s all what we need to do.
Code:
#include <bits/stdc++.h>
using namespace std;
int cal(int num){
int ans = 0;
while (num){
ans += num % 10;
num /= 10;
}
return ans;
}
int n;
int main(){
cin>>n;
int ans = 0;
while (n){
ans++;
if (cal(ans) == 10) n–;
}
cout<<ans;
}