Factorial Solved problem Code:fctrl

Source: Internet
Author: User

1 ImportSYS2 #Import Psyco #很奇怪, this problem with Psyco on runtime error3 4 5 #psyco.full ()6 7 8 defZ (n):#This is supposed to be a trick algorithm.9R =0Ten      while5 <=N: OneN/= 5 AR + =N -     returnR -  the  - defMain (): -n =Int (sys.stdin.readline ()) -      forTinchSys.stdin:#There's no problem with this type of loop. +         PrintZ (int (t)) #输入的是String, be sure to remember int conversion -   +Main ()#this kind of function architecture is very scientific and good

A different approach

1 for n in map (int, Sys.stdin.read (). Split ()) [1:]: 2 print Z (n)

Learn

For T in Sys.stdin this loop input can be reused

This functional architecture is very scientific.

Initial understanding of the array, the use of the colon essence

[1:] escaped the first element (is the number), and then to the last element

Error

Psyco () not always able to use

Factorial Solved problem Code:fctrl

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.