08 2017 档案
摘要:1 import stdarray 2 import math 3 import stddraw 4 import stdaudio 5 import stdio 6 SPS = 44100 7 CONCERT_A = 440.0 8 while not stdio.isEmpty(): 9 pitch = stdio.readInt() 10 duration...
阅读全文
摘要:1 import stddraw 2 3 stddraw.setXscale(-1, 1) 4 stddraw.setYscale(-1, 1) 5 6 DT = 20.0 7 RADIUS = 0.05 8 rx = 0.480 9 ry = 0.860 10 vx = 0.015 11 vy = 0.023 12 while True: 13 #Update b...
阅读全文
摘要:1 import stddraw 2 import stdio 3 # Read and set the x- and y- scales 4 x0 = stdio.readFloat() 5 y0 = stdio.readFloat() 6 x1 = stdio.readFloat() 7 y1 = stdio.readFloat() 8 stddraw.setXscale(x...
阅读全文
摘要:1 import random 2 import sys 3 import stdio 4 import stdarray 5 n = int(sys.argv[1]) 6 trials = int(sys.argv[2]) 7 deadEnds = 0 8 9 for t in range(trials): 10 a = stdarray.create2D(n, n...
阅读全文
摘要:1 import sys 2 import stdarray 3 import stdio 4 n = int(sys.argv[1]); 5 isPrime = stdarray.create1D(n+1, True); 6 for i in range(2,n+1): 7 if isPrime[i]: 8 #Mark multiples of i as...
阅读全文

浙公网安备 33010602011771号