Program marks; var a,b:integer; begin Writeln('Введите кол-во сделанных ошибок: '); readln(a); b:=0; if a=0 then b:=5; if (a>0) and (a<=3) then b:=4; if (a>3) and (a<=5) then b:=3; if (a>5) then b:=2; writeln('Оценка: ',b); readln; end.
int main() { list<int>mylist; //Делаем со списком, что хотим mylist.push_back(1); mylist.push_back(2); mylist.push_back(3); mylist.push_back(-4); mylist.push_back(5); for (auto i : mylist) { cout << i << " "; } cout << "\n"; //Удаляем последний отрицательный элемент auto it = mylist.end(); while (*it > 0) { if (it == mylist.begin()) { cout << "Not found.\n"; return 0; } it--; } //Делаем со списком, что хотим mylist.erase(it); for (auto i : mylist){ cout << i << " "; } return 0; }
var
a,b:integer;
begin
Writeln('Введите кол-во сделанных ошибок: ');
readln(a);
b:=0;
if a=0 then b:=5;
if (a>0) and (a<=3) then b:=4;
if (a>3) and (a<=5) then b:=3;
if (a>5) then b:=2;
writeln('Оценка: ',b);
readln;
end.