Những câu hỏi liên quan
An Vy
Xem chi tiết
Nguyễn Lê Phước Thịnh
17 tháng 3 2022 lúc 14:49

#include <bits/stdc++.h>

using namespace std;

long long i,n,s;

int main()

{

cin>>n;

s=1;

for (i=1; i<=n; i++) if (i%2==0) s*=i;

cout<<s;

return 0;

}

Bình luận (0)
Huệ anh •01•86
Xem chi tiết
Kiều Vũ Linh
17 tháng 3 2022 lúc 9:04

Var i,n:integer;

E:real;

Begin

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

E:=1;

For i:=2 to n do

Begin

E:=E*i;

i:=i+2;

End;

Write('E = ',E:15:0);

Readln;

End.

Bình luận (0)
Đạt Trần
Xem chi tiết
Nguyễn Lê Phước Thịnh
18 tháng 5 2021 lúc 9:49

uses crt;

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

i,n,t:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

for i:=1 to n do 

  write(a[i]:4);

writeln;

t:=0;

for i:=1 to n do 

  if a[i] mod 7=0 then t:=t+a[i];

writeln('Tong cac so chia het cho 7 la: ',t);

readln;

end. 

Bình luận (0)
Yeu DUong nhat
Xem chi tiết
Minh Lệ
17 tháng 5 2021 lúc 21:57

Program HOC24;

var n,d,i: integer;

B: array[1..100] of integer;

t: longint;

begin

write('Nhap N: '); readln(n);

for i:=1 to n do 

begin

write('B[',i,']='); readln(b[i]);

end;

d:=0; t:=0;

for i:=1 to n do 

if b[i]>0 then

begin

d:=d+1;

t:=t+b[i];

end;

writeln('Tong cac so duong trong day so la: ',t);

write('Co ',d,' so duong trong day');

readln

end.

Bình luận (0)
Lê Thị Thu Phương
7 tháng 6 2021 lúc 21:22

uses crt;
var b:array[1..100] of longint;
      n,i,d,s:longint;
begin
      clrscr;
      write('n='); readln(n);
      for i:=1 to n do 
            begin
                  write('a[',i,']: '); readln(b[i]);
                  if b[i]>0 then begin
                        inc(d);
                        inc(s,b[i]);
                  end;
            end;
      writeln('Tong cac so duong: ',s);
      writeln('Co ',d,' so duong');
      readln;
end.

Bình luận (0)
hà phương
Xem chi tiết
Nguyễn Hoàng Tiến
29 tháng 7 2023 lúc 11:21

đitf

Bình luận (0)
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.

Bình luận (1)
nông thị ngân
Xem chi tiết
Nguyễn Lê Phước Thịnh
22 tháng 3 2021 lúc 19:41

uses crt;

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

n,i,k,t,t1:integer;

begin

clrscr;

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

for i:=1 to n do 

  begin

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

end;

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

t:=0;

for i:=1 to n do 

  if a[i] mod 2<>0 then t:=t+a[i];

t1:=0;

for i:=1 to n do 

  if a[i] mod k=0 then t1:=t1+a[i];

writeln('Tong cac phan tu le la: ',t);

writeln('Tong cac phan tu la boi cua ',k,' la: ',t1);

readln;

end.

Bình luận (1)
Yết Thiên
Xem chi tiết
Trúc Giang
12 tháng 5 2021 lúc 9:55

Câu 2:

Program nii;

Uses crt;

Var a,b,c,A:integer;

Begin

Write ('nhap a');

Readln (a);

Write ('nhap b');

Readln (b);

Write ('nhap c');

Readln (c);

A:=a;

If A<b then A:=b;

If A<c then A:=c;

Write ('Ket qua',A);

Readln;

End.

Bình luận (0)
Trúc Giang
12 tháng 5 2021 lúc 9:51

Câu 1

Program ntg;

Uses crt;

Var A,x,y:integer;

Begin

Write ('nhap x');

Readln (x);

Write ('nhap y');

Readln ('y');

A:=x+y;

Write ('Ket qua',A);

Readln;

End.

 

Bình luận (0)
Nguyễn Lê Phước Thịnh
12 tháng 5 2021 lúc 18:43

Câu 2: 

uses crt;

var a,b,c,max:integer;

begin

clrscr;

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

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

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

max:=a;

if max<b then max:=b;

if max<c then max:=c;

writeln('So lon nhat trong 3 so la: ',max);

readln;

end.

Bình luận (1)
An
Xem chi tiết
Nguyễn Lê Phước Thịnh
14 tháng 1 2022 lúc 23:07

#include <bits/stdc++.h>

using namespace std;

double a,b,c,d;

int main()

{

cin>>a>>b>>c>>d;

cout<<a+b+c+d;

return 0;

}

Bình luận (1)
Kiều Vũ Linh
16 tháng 1 2022 lúc 7:51

Var a,b,c,d,s:real;

Begin

Write('nhap so thu nhat ');readln(a);

Write('nhap so thu hai ');readln(b);

Write('nhap so thu ba ');readln(c);

Write('nhap so thu tu ');readln(d);

s:=a+b+c+d;

Write('tong la ',s:10:2);

Readln;

End.

Bình luận (0)