1)
var n:integer;
begin
writeln('Введите номер месяца: ');
readln(n);
if (n = 1) or (n = 2) or (n = 12) then
writeln('Зима');
if (n = 3) or (n = 4) or (n = 5) then
writeln('Весна');
if (n = 6) or (n = 7) or (n = 8) then
writeln('Лето');
if (n = 9) or (n = 10) or (n = 11) then
writeln('Осень');
end.
2)
var n:real;
writeln('Введите температуру: ');
if (34.1 <= n) and (n <= 36.4) then
writeln('Пониженная');
if (36.5 <= n) and (n<= 36.6) then
writeln('Нормальная');
if (36.7 <= n) and (n <= 41) then
writeln('Повышенная');
if (n <= 34) or (n > 41) then
writeln('Не может быть!');
#include <iostream>
using namespace std;
int main(){
int number = 0;
cout << "Enter the month number: ";
cin >> number;
if ((number >= 1) and (number <= 12)){
if (number < 8){
if (number % 2 != 0){
cout << "31 days";
}else if((number % 2 == 0) and (number != 2)){
cout << "30 days";
}else if(number == 2){
cout << "28 days";
}
}else if (number > 7){
}else if(number % 2 == 0){
}else{
cout << "Please enter a valid number";
return 0;
1)
var n:integer;
begin
writeln('Введите номер месяца: ');
readln(n);
if (n = 1) or (n = 2) or (n = 12) then
writeln('Зима');
if (n = 3) or (n = 4) or (n = 5) then
writeln('Весна');
if (n = 6) or (n = 7) or (n = 8) then
writeln('Лето');
if (n = 9) or (n = 10) or (n = 11) then
writeln('Осень');
end.
2)
var n:real;
begin
writeln('Введите температуру: ');
readln(n);
if (34.1 <= n) and (n <= 36.4) then
writeln('Пониженная');
if (36.5 <= n) and (n<= 36.6) then
writeln('Нормальная');
if (36.7 <= n) and (n <= 41) then
writeln('Повышенная');
if (n <= 34) or (n > 41) then
writeln('Не может быть!');
end.
#include <iostream>
using namespace std;
int main(){
int number = 0;
cout << "Enter the month number: ";
cin >> number;
if ((number >= 1) and (number <= 12)){
if (number < 8){
if (number % 2 != 0){
cout << "31 days";
}else if((number % 2 == 0) and (number != 2)){
cout << "30 days";
}else if(number == 2){
cout << "28 days";
}
}else if (number > 7){
if (number % 2 != 0){
cout << "30 days";
}else if(number % 2 == 0){
cout << "31 days";
}
}
}else{
cout << "Please enter a valid number";
}
return 0;
}