Var
Y,X:real;
Begin
Write('X = ');ReadLn(X);
if X<2 then Y:=5
else if X=2 then Y:=2
else Y:=10;
WriteLn('Y = ',Y);
End.
<span>2)
c = 5, когда не выполняется оба условия, то есть:
</span><span><span>If a<7 then c:=10 // a>=7
else if a>7 then c:=2 // a>7
else c:=5
Переменная a может иметь любое значение больше семи.
</span></span>
Uses graphabc;
begin
window.IsFixedSize := true;
window.Height := 600;
window.Width := 800;
pen.Color := clred;
lockdrawing;
for var i := 0 to 750 do
begin
window.Clear;
DrawRectangle(i, 0, 50 + i, 50);
redraw;
end;
end.
V= 36864 бит/с
1стр.= 2304 сим.* 8 бит= 18432 бит
4 стр. = 18432 бит.* 4 = 73728 бит = S
t= ?
t = S/V
t = 73728 бит / 36864 бит/с = 2
ответ: 2
// ConsoleApplication4.cpp: определяет точку входа для консольного приложения.
//
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
class stud {
public:
void setname(string sname)
{
name = sname;
}
string getname()
{
return name;
}
string getsurname()
{
return surname;
}
void setsurname(string ssurname)
{
surname = ssurname;
}
void setscore(int sc[])
{
for (int i = 0; i<10; i++) score[i] = sc[i];
}
float getsr()
{
float sum = 0;
for (int i = 0; i<10; i++) sum += (float)score[i];
return sum / 10;
}
void showmyself()
{
cout << "Студент: " << name << " " << surname << endl;
cout << "Имеет 10 текущих оценок: ";
for (int i = 0; i < 10; i++) cout << score[i] << " ";
cout << "" << endl;
cout << "Его средний балл: " << getsr() << endl;
}
private:
string name;
string surname;
int score[10];
};
int main(int acgc, char* argv[])
{
setlocale(LC_ALL, "rus");
stud student1;
int score[10];
string name, surname;
cout << "Введите имя студента: "<<endl;
getline(cin, name);
cout << "Введите фамилию студента: " << endl;
getline(cin, surname);
cout << "введите 10 текущих оценок через пробел: " << endl;
for (int i = 0; i<10; i++) cin >> score[i];
student1.setname(name);
student1.setsurname(surname);
student1.setscore(score);
student1.showmyself();
system("pause");
}