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

Your feedback is our precious!

Or call +88 02 9853138 for support