you can use gets() ,to read a line and then easily find the individual numbers
On Sun, Jul 3, 2011 at 1:22 AM, anonymous procrastination < [email protected]> wrote: > Hello, > > I came across a problem where the first line of the input specfies a > number n. > Then next n lines, every line contains a few(no limit) number > seperated by spaces. > Then I want to find the sm of numbers on each line. > > eg. > INPUT > 5 > 1 4 5 > 3 1 6 > 11 23 > 1 9 8 7 6 > 7 7 7 > > Now algorithm offcourse is not a problem. But I'm not getting how to > take input in C. > This is driving me crazy. > tried with scanf and getchar but unable to get it right. > Please help > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- *Regards,* *Piyush Kapoor,* *CSE-IT-BHU* -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
