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




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

Your feedback is our precious!

Or call +88 02 9853138 for support