#include <iostream>#include <cstdlib>#include <ctime>
using namespace std;
int main(){ srand(static_cast<unsigned int>(time(0))); //seed random number generator
int secretNumber = rand() % 100 + 1; // random number between 1 and 100 int tries = 0; int guess; cout << "\tWelcome to Guess My Number\n\n";
do { cout << "Enter a guess: "; cin >> guess; ++tries;
if (guess > secretNumber) { cout << "Too high!\n\n"; } else if (guess < secretNumber) { cout << "Too low!\n\n"; } else { cout << "\nThat's it! You got it in " << tries << " guesses!\n"; }
} while (guess != secretNumber);
return 0;}
1) <; <; =; <
2)1025 бит; 1 Кбайт; 1025 байт; 1023 Кбайт ;1 Мбайт; 1 Тбайт
Программа на Паскале
Программа не проверяет x на ОДЗ
Program Project1;
var a, P, S, d :real;
begin
readln(d); a:= d/sqrt(2); S:= sqr(a); P:= 4*a; writeln('Сторона: ',a); writeln('Площадь: ',S); writeln('Периметр: ',P);
end.<span>
</span>
Var a,b,c:real;
begin
read (a,b,c);
if (a<>b) and (a<>c) and (b<>c) then writeln ('НЕТ') else
if (a=b) and (a=c) and (b=c) then writeln ('ВСЕ РАВНЫ') else
writeln ('ДА');
end.