uses crt;
var a:array[1..100,1..100] of integer;
n,m,s:integer;
begin
clrscr;
randomize;
write('n='); read(n);
write('m='); read(m);
for n:=1 to n do
for m:=1 to m do
a[n,m]:=random(100);
writeln('massiv:');
for n:=1 to n do
begin
for m:=1 to m do
write(a[n,m],' ');
writeln;
end;
for n:=1 to n do
for m:=1 to m do
begin
if (a[n,m] mod 5 =0)and (a[n,m] mod 3<>0) then
begin
s:=n;
write('stroka ',s,'; ');
end;
end;
end.
Обычно решают на Pascal, но я напишу на C++, он мне роднее)). Я конечно немножко по-другому реализовал (в плане ввода значений), но поставленную задачу выполняет.
1)
#include <stdio.h>
#inlcude <conio.h>
#include <iostream>
using namespace std;
int main()
{
long a, b, i, sum=0;
cin>>a; // Вводишь число a
cin>>b; // Вводишь число b
for (i=a;i<=b;i++)
{
sum=sum+(i*i);
}
cout<<sum; // выводим сумму квадратов чисел
_getch();
}
2)
#include <stdio.h>
#inlcude <conio.h>
#include <iostream>
using namespace std;
int main()
{
long a,b,c,d,i;
bool z=false;
cin>>a;
cin>>b;
cin>>c;
cin>>d;
for (i=10000; i<=99999; i++)
{
if (i % a==b && i % c==d) {z=true; cout<<i<<" ";}
}
if (z==false) {cout<<"-1";} // Выводится если нет чисел
_getch();
}
100_2 = 4
100_3 = 9
100_4 = 16
100_5 = 25
100_6 = 36
100_7 = 49
100_8 = 64
100_9 = 81
100_10 = 100
100_11 = 121
100_12 = 144
100_13 = 169
100_14 = 196
100_15 = 225
100_16 = 256
100_17 = 289
100_18 = 324
100_19 = 361
100_20 = 400
100_21 = 441
100_22 = 484
100_23 = 529
100_24 = 576
100_25 = 625
100_26 = 676
100_27 = 729
100_28 = 784
100_29 = 841
100_30 = 900
100_31 = 961
100_32 = 1024
100_33 = 1089
100_34 = 1156
100_35 = 1225
100_36 = 1296
<span>Uses crt;
var a,b,c:integer;
begin
read(a);
read(b);
read(c);
if ((a+b)>c) and ((a+c)>b) and ((b+c)>a) then
begin
if ((a=b) and (b<>c)) or ((a=c) and (c<>b)) or ((b=c) and (c<>a)) then writeln('Triangle is isosceles');
if (a=b) and (b=c) and (a=c) then writeln('Triangle is equilateral');
if (a<>b) and (a<>c) and (b<>c) then writeln ('Triangle is scalene');
end
else writeln('Triangle is invalid');
end.</span>
[1;+бесконечности) лови, возможно ответ