August 2021 0 5 Report
Помогите пожалуйста (кто знает паскаль) дана программа:

var g: integer;
i: integer;
begin
readln(g);
if (g>=0) and (g<=100) then i:= 1;
if (g>=101) and (g<=200) then i:= 2;
if (g>=201) and (g<=300) then i:= 3;
if (g>=301) and (g<=400) then i:= 4;
if (g>=401) and (g<=500) then i:= 5;
if (g>=501) and (g<=600) then i:= 6;
if (g>=601) and (g<=700) then i:= 7;
if (g>=701) and (g<=800) then i:= 8;
writeln(i)
end.

можно ли сократить ее? и как, каким оператором?
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Copyright © 2024 SCHOLAR.TIPS - All rights reserved.