919B


  1. #include<bits/stdc++.h>
  2. using namespace std;

  3. int main() {
  4. int n, i, cnt = 0;
  5. cin>>n;

  6. for(i = 0; ; i++){
  7. int temp = i;
  8. int sum = 0;

  9. while(temp){
  10. int rem = temp % 10;
  11. temp /= 10;
  12. sum += rem;
  13. }
  14. if(sum == 10){
  15. cnt++;
  16. if(cnt >= n)
  17. break;
  18. }
  19. }
  20. cout<<i<<endl;

  21. return 0;
  22. }

No comments

Theme images by Jason Morrow. Powered by Blogger.