DCP-187: Beloved Uncle Back to All Problems

Beginner Math > Basic Math


Showmic is a great programmer. He does his all work with the knowledge of programming. He has a little nephew. He reads in class 2. He loves chocolate very much. Each and everyday Showmic brings chocolate for his nephew. On the 1st day he brings 1 chocolate for his nephew. On the 2nd day he brings 2 chocolate for his nephew. And then showmic thinks now he apply his programming knowledge. From then he brings chocolate according to the summation of chocolate that he bought on previous 2 days for his nephew. From then shomics' nephew can't find out on which day his uncle brings such number of chocolate for him. At this time it is your task to help showmics' nephew that on which day his uncle brings such number of chocolate for him. Input: ------ Given the number of chocolate n(n<2^31-1) that Showmic brings for his nephew.. Program ends with End Of File.. Output: ------- Print the day number on which Showmic brings such number of chocolate.. After printing the day number you print a string like.. if day number 1 you print string "st" after day number, if day number 2 you print string "nd" , if day number 3 you print string "rd", and rest of the day number you print string "th" as 4th, 5th etc. format like : Showmic brings n chocolate on result"string"(as described in output) day. Sample Input ------------ 1 3 8 Sample Output ------------- Showmic brings 1 chocolate on 1st day. Showmic brings 3 chocolates on 3rd day. Showmic brings 8 chocolates on 5th day.


Problem Setter:

Md.Ashraful Islam Shohag

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 3.00
Go 3.00
Java 3.00
JavaScript 3.00
Objective-C 3.00
Perl 3.00
PHP 3.00
Python 3.00
Python3 3.00
Ruby 3.00
VB.Net 3.00

Problem Stats

195/721

Solve/Submission

Ranking

# User Language Timing
01 AUIArafat Cpp14 0.00s
02 nakib_ruet Cpp14 0.00s
03 Chayti_Saha98 Cpp14 0.00s
04 Dinar Cpp14 0.00s
05 maxhasan Cpp14 0.00s
06 MAHRahat Cpp14 0.00s
07 Nazmul_WUB Cpp14 0.00s
08 Alice_2 Cpp14 0.00s
09 deder Cpp14 0.00s
10 hmtanbir Cpp14 0.00s
11 deptapaul Cpp14 0.00s
12 jualahmed Cpp14 0.00s
13 feodorv Cpp14 0.00s
14 Saimum_140128 Cpp14 0.00s
15 afzalul Cpp14 0.00s
16 noyonhossen Cpp14 0.00s
17 CSE1604084_Mahir C 0.00s
18 MohammadShamim Cpp14 0.00s
19 mohibur Cpp 0.00s
20 MBSTU_RAKIB_NR Cpp 0.00s
21 5h4n70 Cpp 0.00s
22 mamun02inf Cpp 0.00s
23 Naim1611052 Cpp 0.00s
24 Azizul_cse27 Cpp 0.01s
25 sajib_kumar_biswas Cpp 0.01s
26 leenaiitju Cpp14 0.01s
27 wizard Cpp 0.01s
28 DynamicOvi Cpp 0.01s
29 smriad Cpp14 0.01s
30 Morass Cpp14 0.01s
31 10102020 Cpp 0.01s
32 mahmud2690 Cpp14 0.01s
33 abdulmukit Cpp 0.01s
34 KM_Muntasir Cpp 0.01s
35 joymollick Cpp14 0.01s
36 Mahadi024 Cpp14 0.01s
37 sadia2427 Cpp14 0.01s
38 terminator_c Cpp14 0.01s
39 gulzar Cpp14 0.01s
40 Logic_Hunter Cpp14 0.01s
41 Najat Cpp14 0.01s
42 MamunAmin Cpp14 0.01s
43 sohag_AUST Cpp14 0.01s
44 showmic Cpp14 0.01s
45 omaer1510033 Cpp14 0.01s
46 siamcr7 Cpp14 0.01s
47 Taj025 CSharp 0.02s
48 hasanuzzaman333 CSharp 0.02s
49 rockersabbir CSharp 0.02s
50 saeefad CSharp 0.02s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support