Создать структуру базы данных "Соревнования по фигурному катанию". Задать создание 3 таблиц. Показать связи между таблицами. прислать файл ОЧЕНЬ а то 2 обеспечена заранее
// PascalABC.NET 3.0, сборка 1156 от 30.01.2016 function Avg(a:array[,] of integer):real; begin var s:=0; var k:=0; foreach var e:integer in a do if e>0 then begin s+=e; Inc(k) end; if k>0 then Result:=s/k else Result:=1e-100; end;
begin var A:=MatrixRandom(4,4,-50,50); Writeln(A); Writeln('Среднее арифметическое положительных равно ',Avg(A):0:3); var B:=MatrixRandom(5,5,-30,30); Writeln(B); Writeln('Среднее арифметическое положительных равно ',Avg(B):0:3); var C:=MatrixRandom(4,5,-25,38); Writeln(C); Writeln('Среднее арифметическое положительных равно ',Avg(C):0:3); end.
Тестовое решение: [[35,35,5,-47],[14,34,35,-13],[25,-5,35,-29],[-7,10,-12,12]] Среднее арифметическое положительных равно 24.000 [[-12,-17,-10,19,14],[20,17,-27,-2,16],[-3,-21,30,2,10],[5,-3,-17,-3,18],[0,-26,29,1,-22]] Среднее арифметическое положительных равно 15.083 [[-5,-11,17,-4,15],[15,17,-24,36,15],[-8,-3,-22,28,-25],[-21,6,12,31,-1]] Среднее арифметическое положительных равно 19.200
import random import operator def quiz(): print('Welcome. This is a 10 question math quiz\n') name = input("Please enter your name") print("Hello", name," Let's begin the quiz!") score = 0 for i in range(10): correct = askQuestion() if correct: score += 1 print('Correct!\n') print(score) break else: print('Incorrect!\n') return 'Your score was {}/10'.format(score) def askQuestion(): answer = randomCalc() guess = float(input()) return guess == answer def randomCalc(): ops = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv} num1 = random.randint(0,11) num2 = random.randint(1,11) op = random.choice(list(ops.keys())) answer = ops.get(op)(num1,num2) print('What is {} {} {}?\n'.format(num1, op, num2))
import random import operator def quiz(): print('Welcome. This is a 10 question math quiz\n') name = input("Please enter your name") print("Hello", name," Let's begin the quiz!") score = 0 for i in range(10): correct = askQuestion() if correct: score += 1 print('Correct!') print "Score",(score),"\n" else: print('Incorrect!') print "Score",(score), "\n" print 'Your score was {}/10'.format(score) def askQuestion(): answer = randomCalc() guess = float(input()) return guess == answer def randomCalc(): ops = {'+':operator.add, '-':operator.sub, '*':operator.mul, '/':operator.truediv} num1 = random.randint(0,11) num2 = random.randint(1,11) op = random.choice(list(ops.keys())) answer = ops.get(op)(num1,num2) print('What is {} {} {}?'.format(num1, op, num2)) return answer quiz() #askQuestion() #randomCalc()