title: C, reading date and a number, and sorting
body: <p>I cannot for the life of me figure out how to do this:</p>
  
  <p>I am supposed to read this input in this format:</p>
  
  <p>yyyy mm dd total(of sales)</p>
  
  <p>i.e.</p>
  
  <p>1990 11 22 6.89</p>
  
  <p>1990 11 24 7.20</p>
  
  <p>1991 2  4  5.36</p>
  
  <p>... (all entries are assumed to be sorted by year, then month, then day)</p>
  
  <p>Then I am to print the input values, subtotals for each month, subtotals for each year, and a grand total.</p>
  
  <p>My question: How do I store the input values while keeping each entry consistent?? I have to be able to check if I am in the same year and month when calculating subtotals. And I need to access each float number in order to calculate subtotals.</p>
  
  <p>Oh and I can only use stdio.h or create my own functions.</p>
  
  <p>So how do I store them so that I can reference each value while keeping them consistent??</p>
  
  <p>Any help would be GREATLY appreciated. Thank you in advance.</p>