![]() |
|
[C] why this code isn't working - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C] why this code isn't working (/showthread.php?tid=5889046) |
why this code isn't working - Quality_k1nG - Sep 26, 2018 Code #include<stdio.h>I am trying to create a test cased , like if we put 2 then loop will work twice then whatever we put twice like 5 and 7 , each loop work like 5 times n and 7 times and so on RE: why this code isn't working - 0x45 - Sep 26, 2018 Probably what you need instead is Code for(i=0;i<test;i++){Not sure If i understood your question RE: why this code isn't working - Quality_k1nG - Sep 27, 2018 (Sep 26, 2018 10:24 PM)0x45 Wrote: Probably what you need instead is Hey thank you for the reply. what i want is I was doing some problem on hackerearth.com there they given some test cases (suppose input is 2) then I need to go through the 2 input and again loop inside the 2 like this https://i.imgur.com/W08pxZT.png RE: why this code isn't working - walt3r - Sep 27, 2018 Try this one, actually I couldn't see your screenshot but I think this is the correct answer. Code #include<stdio.h>Maybe this part is better with this: http://prntscr.com/kz9ieu RE: why this code isn't working - Legionhoster - Sep 27, 2018 Code should be like this: Code #include<stdio.h>I hope this helps. RE: why this code isn't working - 0xDEAD10CC - Sep 27, 2018 It would be much better if you showed the dataset rather than your poor paint drawing. Sounds similar to the codejam type of problems. Code void process_case(FILE *fp)You'd set it up something like this. RE: why this code isn't working - Quality_k1nG - Sep 27, 2018 (Sep 27, 2018 06:10 PM)0xDEAD10CC Wrote: It would be much better if you showed the dataset rather than your poor paint drawing. Sounds similar to the codejam type of problems. through diagram, it would be much easier to follow idk:D anyway thank for helping |