===== PascalABC.NET =====
begin
ReadSeqIntegerWhile(p -> p <> 0)
.Where(p -> p mod 3 = 0).Min.Println
end.
6.1
#include <iostream>
#include <ctime>
#include <random>
using namespace std;
mt19937 gen(time(0));
uniform_int_distribution<> uid(0, 9);
int main()
{
int a[5][5];
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < 5; ++j) {
a[i][j] = uid(gen);
cout << a[i][j] << " ";
}
cout << endl;
}
return 0;
}
Составим план:
1История создания
2использование человеком
3Внешнее стоение
4 Внутреннее строение
Ну и т.д.
Вот так можно решить
Program M;
var i : integer = 0;
pologitelnie : integer = 0;
otricatelnie : integer = 0; a : array[0..100] of Integer;
begin
repeat
begin
read (a[i]);
if (a[i]>=0) then
pologitelnie := pologitelnie + 1
else
otricatelnie := otricatelnie + 1;
i := i + 1;
end;
until a[i-1] = 0;
writeln('положительных: ', pologitelnie);
writeln('отрицательных: ', otricatelnie);
end.
//Dev-C++ 5.11
#include <iostream>
using namespace std;
int main(void)
{float a,b;
cin>>a>>b;
if(a==0 && b==0)
cout<<"No solve";
else
if (b==0)
cout<<"No solve";
else
if(a==0)
cout<<"(-infinity;+infinity)";
else
{if(b>0 && a>0) cout<<"(-infinity;"<<a/b<<")";
if(b<0 && a>0) cout<<"("<<a/b<<";+infinity)";
if(b>0 && a<0) cout<<"("<<a/b<<";+infinity)";
if(b<0 && a<0) cout<<"(-infinity;"<<a/b<<")";}
return 0;}
Пример ввода:
1
-7
Пример вывода:
(-0.142857;+infinity)