срочно, даю 100 баллов
Ответы на вопрос
Язык — Java.
1.
import java.util.Scanner;
public class Znanija {
public static void main(String args[]) {
int number, n, result, buf;
result = 1-2;
Scanner input = new Scanner(System.in);
System.out.println("Write the value of \"n\": ");
n = input.nextInt();
for(int i = 1; i<n+1; i++) {
result = result*(1-(i+1));
}
System.out.println("\n" + result);
}
}
2.
import java.util.Scanner;
public class Znanija {
public static void main(String args[]) {
int one, two, three, four, five, six, seven, eight, nine, ten;
Scanner input = new Scanner(System.in);
System.out.println("Write the first number: ");
one = input.nextInt();
System.out.println("\nWrite the second number: ");
two = input.nextInt();
System.out.println("\nWrite the third number: ");
three = input.nextInt();
System.out.println("\nWrite the fourth number: ");
four = input.nextInt();
System.out.println("\nWrite the fifth number: ");
five = input.nextInt();
System.out.println("\nWrite the sixth number: ");
six = input.nextInt();
System.out.println("\nWrite the seventh number: ");
seven = input.nextInt();
System.out.println("\nWrite the eighth number: ");
eight = input.nextInt();
System.out.println("\nWrite the ninth number: ");
nine = input.nextInt();
System.out.println("\nWrite the tenth number: ");
ten = input.nextInt();
int addition = (int)Math.pow(one, 2)+(int)Math.pow(two, 2)+(int)Math.pow(three, 2)+(int)Math.pow(four, 2)+(int)Math.pow(five, 2)+(int)Math.pow(six, 2)+(int)Math.pow(seven, 2)+(int)Math.pow(eight, 2)+(int)Math.pow(nine, 2)+(int)Math.pow(ten, 2);
System.out.println("\n" + addition);
}
}
3.
import java.util.Scanner;
public class Znanija {
public static void main(String args[]) {
boolean isInteger;
Scanner input = new Scanner(System.in);
String number;
int amount = 0;
double buf;
System.out.println("Enter the number: ");
for(int i = 0; i<15; i++) {
number = input.nextLine();
buf = Double.parseDouble(number);
if (buf%1 == 0) {
isInteger = true;
amount += 1;
}
}
System.out.println("\nThe amount of integers is: " + amount);
}
}
4.
import java.util.Scanner;
public class Znanija {
public static void main(String args[]) {
boolean isEven;
int n = -10, m = 10, buf, i;
for(i = n; i<=m; i++) {
if(i%2 == 0) {
isEven = true;
System.out.println(i);
}
}
}
}