-
Notifications
You must be signed in to change notification settings - Fork 9
/
ErsinHocaDersOrnegi.py
68 lines (54 loc) · 1.13 KB
/
ErsinHocaDersOrnegi.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 11:20:43 2019
@author: gozdemihranaltinsoy
"""
f=open("11.txt","r+",encoding="utf-8")
a=f.read()
#print(a[0])
"""
a=str(a)
b=a.split()
print(b)
"""
a=list(a)
b=[]
for i in a:
if i==" " or i=="\n":
a.remove(i)
"""
for i in range(0,len(a)-1,2):
s=str(a[i])+str(a[i+1])
b.append(s)
"""
for i in range(0,len(a)-1):
if i%2==0:
s=str(a[i])+str(a[i+1])
b.append(s)
#print(b)
e=[ [0 for i in range(20)] for j in range(20) ] #400 eleman
print(e)
sayac=0
for i in range(0,20):
for j in range(0,20):
e[i][j]=b[sayac]
sayac+=1
print(e)
#Matrisin ilk satırının elemanları toplamı
toplam=0
for i in range(0,20):
toplam+=int(e[0][i])
#string olduğu için int dönüştürdük
print(toplam)
c=[]
for i in range(0,20):
for j in range (0,17):
carpim=1
for k in range(0,4):
carpim*=int(e[i][j+k])
c.append(carpim)
#string olduğu için int dönüştürdük
c.sort(reverse=False)
#Küçükten büyüğe sıralar
print(c)
print(max(c))