Код на Java:
import java.util.Scanner;
public class Znanija{
public static void main(String args[]) {
double number;
Scanner input = new Scanner(System.in);
System.out.println("Enter the number: ");
number = input.nextInt();
if(number>100) {
System.out.println("\nThe entered number is greater than 100, so we divide by 10: " + number/10);
}
else {
System.out.println("\nThe entered number is less than 100, read its square, and multiply by 100: " + Math.pow(number, 2)*100);
integer number
print("Enter the number: ")
input.number
if number>100
print("The entered number is greater than 100, so we divide by 10: ", number/10)
else
print("The entered number is less than 100, read its square, and multiply by 100: ", number*number*100)
a10 = []
b10 = []
c10 = []
res10a=0
res10b=0
res10c=0
a10 += [int(input('Введите для %d ученика 10А = '%(i+1))) for i in range(0,5)]
b10 += [int(input('Введите для %d ученика 10Б = '%(i+1))) for i in range(0,5)]
c10 += [int(input('Введите для %d ученика 10В = '%(i+1))) for i in range(0,5)]
for i in range(5):
res10a += a10[i]
res10b += b10[i]
res10c += c10[i]
print("Cреднее время заплыва учениками 10A: ",(float(res10a)/5))
print("Cреднее время заплыва учениками 10Б: ",(float(res10b)/5))
print("Cреднее время заплыва учениками 10В: ",(float(res10c)/5))
Код на Java:
import java.util.Scanner;
public class Znanija{
public static void main(String args[]) {
double number;
Scanner input = new Scanner(System.in);
System.out.println("Enter the number: ");
number = input.nextInt();
if(number>100) {
System.out.println("\nThe entered number is greater than 100, so we divide by 10: " + number/10);
}
else {
System.out.println("\nThe entered number is less than 100, read its square, and multiply by 100: " + Math.pow(number, 2)*100);
}
}
}
Псевдокод:integer number
print("Enter the number: ")
input.number
if number>100
print("The entered number is greater than 100, so we divide by 10: ", number/10)
else
print("The entered number is less than 100, read its square, and multiply by 100: ", number*number*100)
a10 = []
b10 = []
c10 = []
res10a=0
res10b=0
res10c=0
a10 += [int(input('Введите для %d ученика 10А = '%(i+1))) for i in range(0,5)]
b10 += [int(input('Введите для %d ученика 10Б = '%(i+1))) for i in range(0,5)]
c10 += [int(input('Введите для %d ученика 10В = '%(i+1))) for i in range(0,5)]
for i in range(5):
res10a += a10[i]
for i in range(5):
res10b += b10[i]
for i in range(5):
res10c += c10[i]
print("Cреднее время заплыва учениками 10A: ",(float(res10a)/5))
print("Cреднее время заплыва учениками 10Б: ",(float(res10b)/5))
print("Cреднее время заплыва учениками 10В: ",(float(res10c)/5))