Ответы
Ответ дал:
0
var i,sum:integer;
begin
sum:=0;
for i:=1 to 100 do
if i mod 2 = 1 then sum:=sum+i;
writelnI(sum);
end.
Ответ дал:
0
Нужен в ассемблере с вставкой с++
Типо того:
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int summ = 0;
for (int i = 1; i < N; i+=2)
{
_asm
{
mov ebx, [i]
shl ebx, 2
lea esi, arr
add esi, ebx
lodsd
cmp eax, 100
ja _next
test eax, 0x80000000
jnz _next
test eax, 0x1
jnz _next
add summ, eax
_next:
}
}
cout << summ;
return 0;
}
Типо того:
#include
#include
#include
#include
#include
using namespace std;
int main()
{
int summ = 0;
for (int i = 1; i < N; i+=2)
{
_asm
{
mov ebx, [i]
shl ebx, 2
lea esi, arr
add esi, ebx
lodsd
cmp eax, 100
ja _next
test eax, 0x80000000
jnz _next
test eax, 0x1
jnz _next
add summ, eax
_next:
}
}
cout << summ;
return 0;
}
Ответ дал:
0
Ответ:
program gg;
uses crt;
var
a:array[1..10] of integer;
sum,i:integer;
begin
clrscr;
writeln('vvedite 4isla');
for i:=1 to 10 do
readln(a[i]);
for i:=1 to 10 do
if (a[i]>0) and (a[i] mod 2 <>0) and (a[i]<100)
then begin
sum:=sum+a[i];
end;
writeln('summa: ',sum);
readln;
end.
Объяснение:
Похожие вопросы
2 года назад
8 лет назад