Advertisement
Farjana_akter

Untitled

Feb 16th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7. int t,i,j,k,n,a,b,c,d,div[1000],order[10000],e,f,count=0;
  8. for(i=1;i<=1000;i++)
  9. {
  10. a=i;
  11. count=0;
  12. for(j=1;j<=a;j++)
  13. {
  14. if(a%j==0)
  15. {
  16. count++;
  17. }
  18. }
  19. div[a]=count;
  20. }
  21. k=0;
  22. for(i=1;i<=1000;i++)
  23. {
  24. for(j=1000;j>=1;j--)
  25. {
  26. if(div[j]==i)
  27. order[++k]=j;
  28. }
  29. }
  30. cin>>t;
  31. for(i=1;i<=t;i++)
  32. {
  33. cin>>n;
  34. cout<<"Case "<<i<<": "<<order[n]<<endl;
  35. }
  36. return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement