We at IIIT-Delhi would like to invite you to ProCon 2018, the annual programming contest conducted as a part of our technical festival — Esya. It will start at 21:00 IST on 16th August, 2018. There will be 6 problems of varying difficulty to be solved within a duration of 2 hours, with ACM-ICPC style scoring. The contest will be rated for everyone (Division 1 and Division 2). Top participants will be rewarded CodeChef Laddus. Moreover, there will be Cash Prizes for the Top 3 Indian contestants.
Hey can u tell me why the solution 1 is not working while the solution 2 is giving the correct answer . The only difference between them is in first solution i have used the setprecision and in the second one i have used printf()
Yes, there might be a difference. This is because setprecision defines the total number of digits to be printed when used without fixed (default format) rather than the number of digits after the decimal point.