Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
Vân anh
Xem chi tiết
Phía sau một cô gái
22 tháng 4 2023 lúc 20:18

program TongChanLe;

var

     n,i, chans, les: integer; a: array[1..100] of integer;

begin

     chans := 0;

     les := 0;

     write('Nhap n: ');

     readln(n);

     for i:=1 to n do

     begin

          write('Nhap so thu ', i, ': ');

          readln(a[i]);

          if a[i] mod 2 = 0 then

               chans := chans + a[i]

          else

               les := les + a[i];

     end;

     writeln('Tong cac so chan la: ', chans);

     writeln('Tong cac so le la: ', les);

     readln;

end.

Minasua Yagami
Xem chi tiết
Trần Ái Linh
17 tháng 6 2021 lúc 16:59

program im_14424;

uses crt;

var A: array[1..9999999] of interger;

S,P : integer;

i,n: byte;

begin

clrscr;

S:=0;

P:=0;

for i:=1 to n do

begin

write('Nhap vao phan tu thu: ',i,);

readln(A[i]);

S:=S+A[i]

P:=P*A[i]

end;

writeln(S);

write(P);

readln;

end.

HUY HUỲNH QUANG
Xem chi tiết
Kiều Vũ Linh
5 tháng 5 2023 lúc 14:54

Bài 5:

Var a:array:[1..1000] of integer;

i,n,max:integer;

sc, sl:longint;

Begin

Write('n = ');readln(n);

For i:=1 to n do

Begin

Write('Nhap so thu ',i,' = ');rreadlna[i]);

If a[i] mod 2 = 0 then sc:=sc+b[i];

If a[i] mod 2 <> 0 then sl:=sl+a[i];

End;

max:=a[1];

For i:=2 to n do

If a[i] > max then max:=a[i];

Writeln('Tong cac so chan la ',sc);

Writeln('Tong cac so le la ',sl);

write('So lon nhat la ',max);

Readln

End.

hà phương
Xem chi tiết
Nguyễn Hoàng Tiến
29 tháng 7 2023 lúc 11:21

đitf

k_o_t_en
Xem chi tiết
Phía sau một cô gái
8 tháng 5 2023 lúc 20:22

program BaiTap;

var

      A: array[1..150] of integer;

      N, i, sum: integer;

begin

      write('Nhap so phan tu cua day A (N <= 150): ');

      readln(N);

      for i := 1 to N do

      begin

            write('Nhap phan tu thu ', i, ': ');

            readln(A[i]);

      end;

      writeln('Day so vua nhap la:');

      for i := 1 to N do

            write(A[i], ' ');

      writeln;

      sum := 0;

      for i := 1 to N do

            if A[i] mod 2 = 0 then

                  sum := sum + A[i];

      writeln('Tong cac phan tu chan trong day la: ', sum);

      readln;

end.

Đặng Đức Nam
Xem chi tiết
Kiều Vũ Linh
20 tháng 4 2023 lúc 8:56

Var a:array[1..1000] of integer;

i,n:integer;

sc,sl:longint;

Begin

Write('Nhap so luong so cua day ');readln(n);

For i:=1 to n do

Begin

Write(a,'[',i,'] = ');readln(a[i]);

End;

Write('Tong cac so chan la ');

For i:=1 to n do

If a[i] mod 2 = 0 then sc:=sc+a[i];

Writeln(sc);

Write('Tong cac so le la ');

For i:=1 to n do

If a[i] mod 2 <> 0 then sl:=sl+a[i];

Write(sl);

Readln

End.

AETC丶NhấtㅤGG
Xem chi tiết
Nguyễn Lê Phước Thịnh
10 tháng 5 2022 lúc 23:30

1:

#include <bits/stdc++.h>

using namespace std;

long long n=10, a[10],i,nn;

int main()

{

for (i=1; i<=n; i++) cin>>a[i];

nn=a[1];

for (i=2; i<=n; i++) nn=min(nn,a[i]);

cout<<nn;

return 0;

}

06 mkhang
Xem chi tiết
Ho Hai Trieu
Xem chi tiết
HT.Phong (9A5)
15 tháng 3 2023 lúc 17:07

uses crt;

var a:array[1..100]of integer;

n,i:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do

begin

write('A[',i,']='); readln(a[i]);

end;

writeln('Cac phan tu chan la: ');

for i:=1 to n do

if a[i] mod 2=0 then write(a[i]:4);

readln;

end.

Ho Hai Trieu
15 tháng 3 2023 lúc 17:03

mn giúp em với ạ uhuhu

 

Kiều Vũ Linh
15 tháng 3 2023 lúc 17:37

Var i,n:integer;

Begin

Write('n = ');readln(n);

For i:=1 to n do

Begin

Write('nhap so thu ',i,' = ');readln(a[i]);

End;

Write('cac so chan la: ');

For i:=1 to n do

If a[i] mod 2 = 0 then write(a[i]:6);

End;

Writeln;

Write('cac so le la: ');

For i:=1 to n do

If a[i] mod 2 <> 0 then write(a[i]:6);

Readln;

End.