Код на 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)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Код на 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)