import random
while True:
first_number = random.randint(1, 10)
second_number = random.randint(1, 10)
print('Сколько будет ', first_number, 'умножить на ', second_number)
a = int(input('ответ - '))
sum = first_number*second_number
if a == sum:
print("Вы ответили верно!")
else:
print('ответ не верен!')
print('Продожаем играть?')
b = input("ответ(строго да или нет) - ")
if b.lower() == "да":
print("начнем заново")
else:
break
Объяснение:
Язык — Java
Очевидно, что я пишу не на том языке, на каком надо, ведь ты не отметил нужный.
Но если ты попросишь, может мне и будет хватать сил писать псевдокод :D
import java.util.Scanner;
public class Znanija {
public static void main(String args[]) {
double x, y, z;
double real, denominator, numerator, numerator1, fraction;
Scanner input = new Scanner(System.in);
System.out.println("Enter the value of \"x\": ");
x = input.nextInt();
System.out.println("\nEnter the value of \"y\": ");
y = input.nextInt();
System.out.println("Input the value of \"z\": ");
z = input.nextInt();
denominator = Math.pow(x+y, 6);
numerator = Math.pow((Math.pow((Math.sqrt(((x*x)+(y*y, 1.71)), 3);
numerator1 = numerator+(Math.pow(x+y, 2)+1);
fraction = denominator/numerator;
if (z > fraction) {
System.out.println("\nThe value of \"z\" is greater, then the equation, so here's the result: " + Math.pow(z, 2));
}
else if (z == fraction) {
System.out.println("\nThe values of both variables are equal, so here's the result: " + z);
}
else {
System.out.println("\nThe value of \"z\" is lees then the eqation, so here's the result: " + Math.sqrt(z));
}
}
}
Поделитесь своими знаниями, ответьте на вопрос:
Соператора паскаля for вывести на экран: 1) все четные числа из диапазона от a до b, кратные трем (a 2) все двузначные числа, в которых старшая цифра отличается от младшей не больше чем на 1; 3) все трехзначные числа, в которых хотя бы две цифры повторяются.
Var i,a,b:longint;
Begin
read(a,b);
for i:=a to b do
if (i mod 3=0) then write(i,' ');
writeln;
End.
2)
Var i:longint;
Begin
for i:=10 to 99 do
if (abs(i mod 10 - i div 10)<=1) then write(i,' ');
writeln;
End.
3)
Var i,s,f,t:longint;
Begin
for i:=100 to 999 do
begin
f:=i div 100;
s:=i div 10 mod 10;
t:=i mod 10;
if (f=s) or (f=t) or (s=t) then write(i,' ');
end;
writeln;
End.