Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

FCTRL time limit xceedd ..

$
0
0

how can i optimise my code such dat it dont xceed the time limit ..q. is fctrl

include<iostream>

include<stdio.h>

include<stdlib.h>

using namespace std;

    int fact(int n){

       int i,x=0;

  for(i=n;i>=1;i--)
            {
                n=n/5;
                x=x+n;
            }
            return x;
     }

      int main()
 {
int t;
int n;
scanf("%u",&t);
    while(t--)
    {
            scanf("%u",&n);
            printf("%d",fact(n));
            printf("\n");



    }

return 0;

}


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>