Saleh127

uva 10101.cpp

Jun 8th, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. #define pi acos(-1)
  7. #define yes printf("YES\n");
  8. #define no printf("NO\n");
  9. int main()
  10. {
  11. Faster
  12. ll cas=1,n;
  13. while(scanf("%lld",&n)!=EOF)
  14. {
  15. printf("%4lld.",cas++);
  16. if(n==0)
  17. {
  18. printf(" 0\n");
  19. continue;
  20. }
  21. int a[15]={0},i=14,c;
  22. while(n)
  23. {
  24. a[i]=n%10;
  25. i--;
  26. n=n/10;
  27. }
  28. c=a[0];
  29. if(c)
  30. {
  31. printf(" %d kuti",c);
  32. }
  33. c=a[1]*10+a[2];
  34. if(c)
  35. {
  36. printf(" %d lakh",c);
  37. }
  38. c=a[3]*10+a[4];
  39. if(c)
  40. {
  41. printf(" %d hajar",c);
  42. }
  43. c=a[5];
  44. if(c)
  45. {
  46. printf(" %d shata",c);
  47. }
  48. c=a[6]*10+a[7];
  49. if(c)
  50. {
  51. printf(" %d",c);
  52. }
  53. if(i<7)
  54. {
  55. printf(" kuti");
  56. ///cause 10000000000 er time a na hoi shudu 1 hajar print kore;
  57. ///oitaa handle er jonno ei condition
  58. }
  59. c=a[8]*10+a[9];
  60. if(c)
  61. {
  62. printf(" %d lakh",c);
  63. }
  64. c=a[10]*10+a[11];
  65. if(c)
  66. {
  67. printf(" %d hajar",c);
  68. }
  69. c=a[12];
  70. if(c)
  71. {
  72. printf(" %d shata",c);
  73. }
  74. c=a[13]*10+a[14];
  75. if(c)
  76. {
  77. printf(" %d",c);
  78. }
  79. printf("\n");
  80. }
  81. return 0;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment