Skip to content.

kagome.lab.tkikuchi.net

Sections
Personal tools
You are here: Home » Members » tkikuchi's Home » 授業 » 専門コア情報処理演習(2006) » 解答例9
Views

解答例9

Document Actions

問題1

  • #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    sum = 0
    x = input('? ')
    while x > 0:
        sum = sum + x
        x = input('? ')
    print sum
    

問題2

  • #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    import sys
    import time
     
    t = int(sys.argv[1])
    for i in range(1, t+1):
        print i
        time.sleep(1)
    print '*** BANG ***'
    

問題3

  • #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    import sys
    import time
     
    t = int(sys.argv[1])
    for i in range(t, 0, -1):
        print i
        time.sleep(1)
    print chr(7)*3
    
Created by tkikuchi
Last modified 2006-12-17 10:26
 

Powered by Plone

This site conforms to the following standards: