Система Диофанта | страница 27



>38 | List = []

>39 |

>40 | for i in range(50000):

>41 | . . x1 = gen_number(4) * gen_number(4)

>42 | . . x2 = gen_number(7)

>43 | . . b = x1 + x2

>44 | . . c = x1 * x2

>45 | . .

>46 | . . m = str(b) + ' ' + str(c)

>47 | . . . . . .

>48 | . . if comp_List(List, m):

>49 | . . . . List.append(m)

>50 | . . . . if b != 0 and abs(c) < 126:

>51 | . . . . . . if tr == 0:

>52 | . . . . . . . . f.write('')

>53 | . . . . . . . . f2.write('')

>54 | . . . . . . f.write('

')

>55 | . . . . . . f.write(str(count) + ') x2 '+ show_numb(b*-1) + 'x ' +show_numb(c) + ' = 0' )

>56 | . . . . . . f.write('

\n')

>57 | . . . . . . f2.write('

')

>58 | . . . . . . f2.write(str(count) + ') x1 = '+ str(x1) + '; x2 = ' + str(x2) )

>59 | . . . . . . f2.write('

\n')

>60 | . . . . . . count += 1

>61 | . . . . . . tr += 1

>62 | . . . . . . if tr == 3:

>63 | . . . . . . . . f.write('')

>64 | . . . . . . . . f2.write('')

>65 | . . . . . . . . tr = 0

>66 |

>67 | f2.write('\n')

>68 | f2.write('')

>69 | f2.close()

>70 | f.write('\n')

>71 | f.write('')

>72 | f.close()

>73 |

>74 | print 'Done.'