package testStudentCode;
//import java.util.Arrays;
import java.util.Scanner;
public class TestStudentCode {
public static void main(String[] args) {
/* This reads the input provided by user
* using keyboard
*/
Scanner scan = new Scanner(System.in);
System.out.print("a = ?");
// This method reads the number provided using keyboard
double a = scan.nextDouble();
System.out.print("b = ?");
double b = scan.nextDouble();
// Closing Scanner after the use
scan.close();
System.out.println(a + "x + (" + b + ") = 0");
if (a == 0) {
System.out.println("a = 0");
} else {
double x = - b / a;
System.out.println("x = " + x);
}
}
}
Объяснение:
как то так
program calklin;
uses
crt;
var
a, b, x: real;
begin
textcolor(red);
gotoxy(10, 5);
write('Вас приветствует калькулятор решать линейные уравнения');
gotoxy(10, 6);
write('Введите а=');
readln(a);
gotoxy(10, 7);
write('Введите b=');
readln(b);
gotoxy(10, 8);
if a = 0
then
begin
gotoxy(10, 9);
textcolor(red);
writeln('Нет корней')
end
else
begin
if a <> 0
then
begin
gotoxy(10, 10);
textcolor(red);
x := (-b / a);
writeln('Уравнение имеет корень и он равен: x =', x, '');
end;
end;
end.
х - то что ищем.
16*х/8 - х = 8000
2х - х = 8000
х = 8000 бит
2)
х - то что ищем.
16х бит = 2Мбайт
16х бит = 2*1024*1024*8 бит = 16 777 216 бит
х = 16 777 216 бит / 16 бит = 1 048 576 символов
3)
10*1024*8/8/32/40 = 8 бит на символ
2^8 = 256 символов в алфавите