- Notifications
You must be signed in to change notification settings - Fork 334
/
Copy pathverify.py
executable file
·28 lines (26 loc) · 711 Bytes
/
verify.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
expect= [0, 1]
result= []
result_split= []
dics= []
foriinrange(2, 101):
expect.append(expect[i-1] +expect[i-2])
withopen('out', 'r') asf:
tmp=f.readline()
while (tmp):
result.append(tmp)
tmp=f.readline()
f.close()
forrinresult:
if (r.find('Reading') !=-1):
result_split.append(r.split(' '))
k=int(result_split[-1][5].split(',')[0])
f0=int(result_split[-1][9].split('.')[0])
dics.append((k, f0))
foriindics:
fib=i[1]
if (expect[i[0]] !=fib):
print('f(%s) fail'%str(i[0]))
print('input: %s'%(fib))
print('expected: %s'%(expect[i[0]]))
exit()