Program o;
uses crt;
var
B:array[1..10] of integer;
i,k,n,kol:integer;
begin
writeln ('vvedite kol-vo elementov massiva');
readln(n);
for i:=1 to 10 do
begin
writeln ('a[',i,']=');
readln(B[i]);
if b[i] > 0 then k[i]:=b[i]*b[i];
writeln(k[i]);
end;
end.
begin
writeln('Введите часы: ');
readln(a);
writeln('Введите минуты: ');
readln(b);
if (a > 6) and (a < 10) then writeln('Утро');
if (a = 10) and (b = 0) then writeln('Утро');
if (a = 6) and (b >= 30) then writeln('Утро');
if (a > 10) and (a < 16) then writeln('День');
if (a = 10) and (b >= 1) then writeln('День');
if (a = 16) and (b <= 30) then writeln('День');
if (a > 16) and (a < 22) then writeln('Вечер');
if (a = 22) and (b = 0) then writeln('Вечер');
if (a = 16) and (b >= 31) then writeln('Вечер');
if (a > 22) or (a < 6) then writeln('Ночь');
if (a = 22) and (b >= 1) then writeln('Ночь');
if (a = 6) and (b <= 30) then writeln('Ночь');
end.
import java.util.Scanner;
public class Main {
static int col=0;
public static void main(String[] args) {
Container c1 =new Container(10,4,2.5);
v2(c1);
System.out.println(col);
}
static void v2(Container container) {
System.out.println("Ведите размеры авто");
Scanner scanner = new Scanner(System.in);
double l= scanner.nextInt();
double h=scanner.nextInt();;
double w=scanner.nextInt();;
Car car = new Car(l,h,w);
if (container.hashCode() >= car.hashCode()) {
container.widht = container.widht - car.widht;
container.height= container.height - car.height;
container.leng = container.leng - car.leng;
col++;
v2(container);
}
}
}
public class Car {
final double leng;
final double height;
final double widht;
Car(double leng,double height,double widht){
this.leng=leng;
this.height=height;
this.widht=widht;
}
@Override
public int hashCode() {
return (int) (leng+height+widht);
}
}
public class Container {
static double leng;
static double height;
static double widht;
Container(double leng,double height,double widht){
this.leng=leng;
this.height=height;
this.widht=widht;
}
@Override
public int hashCode() {
return (int) (leng+height+widht);
}
}