document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. //
  2. //  FCTRL.c
  3. //  11. Factorial
  4. //
  5. //  Created by Catarina Moreira on 09/01/13.
  6. //  Copyright (c) 2013 Catarina Moreira. All rights reserved.
  7. //
  8.  
  9. #include <stdio.h>
  10.  
  11. int main(int argc, const char * argv[])
  12. {
  13.     int NUM_TESTS;
  14.    
  15.     scanf("%d", &NUM_TESTS);        // read total test cases from input
  16.  
  17.     int t;
  18.     for (t = 0; t < NUM_TESTS; t++)
  19.     {
  20.        unsigned long long INPUT;   
  21.        scanf("%llu", &INPUT);       // read input data
  22.        
  23.        unsigned long long result = 0;
  24.        while( INPUT )
  25.        {
  26.           result += INPUT/5;        // for every multiple of 5 add the respective ...
  27.       INPUT /= 5;           // ... num of zeros to the result
  28.     }
  29.     printf("%llu\\n", result);
  30.     }
  31.     return 0;
  32. }
');