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
Phan Thị Ka
Xem chi tiết
Minh Lệ
19 tháng 3 2023 lúc 22:40

Câu 1:

Program HOC24;

var i,p: integer;

t: longint;

begin

write('Nhap P: '); readln(p);

t:=0;

for i:=1 to p do if i mod 2<>0 then t:=t+i;

write('Tong cac so le la: ',t);

readln

end.

Minh Lệ
19 tháng 3 2023 lúc 22:41

Câu 2:

Program HOC24;

var i,n: integer;

t: longint;

begin

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

t:=0;

for i:=1 to n do if i mod 2=0 then t:=t+i;

write('Tong cac so chan la: ',t);

readln

end.

Minh Lệ
19 tháng 3 2023 lúc 22:42

Câu 3:

Program HOC24;

var i,t,n: integer;

begin

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

t:=0;

for i:=1 to n do if n mod i=0 then t:=t+i;

write('Tong cac uoc cua ',n,' la: ',t);

readln

end.

Đỗ Trọng TÍn
Xem chi tiết
Kiều Vũ Linh
29 tháng 4 2023 lúc 7:52

Câu 3:

Var i,n:integer:

Begin

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

Write('Cac uoc cua n la ');

For i:=1 to n do

If n mod i = 0 then write(i:8);

Readln

End.

Kiều Vũ Linh
29 tháng 4 2023 lúc 7:56

Câu 4

Var i,n:integer:

Begin

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

Write('Cac so le nho hon n la ');

For i:=1 to n - 1 do

If i mod 2 <> 0 then write(i:8);

Readln

End.

Yna Lolipop
Xem chi tiết
Nguyễn Lê Phước Thịnh
2 tháng 3 2022 lúc 23:11

1:

#include <bits/stdc++.h>

using namespace std;

long long dem,i,n,x;

int main()

{

cin>>n;

dem=0;

for (i=1; i<=n; i++)

{

cin>>x;

if (x%2==0) dem++;

}

cout<<dem;

return 0;

}

Câu 2: 

#include <bits/stdc++.h>

using namespace std;

long long x,n,i,t;

int main()

{

cin>>n;

t=0;

for (i=1; i<=n; i++)

{

cin>>x;

if (x%3==0) t+=x;

}

cout<<t;

return 0;

}

Anh Quynh
Xem chi tiết
Kiều Vũ Linh
27 tháng 4 2023 lúc 17:54

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

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 vua nhap la ');

For i:=1 to n do write(a[i]:8);

Readln

End.

Hưng Quốc
Xem chi tiết
HT.Phong (9A5)
31 tháng 3 2023 lúc 16:51

1. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do write(i:3);

readln;

end.

2. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do if(i mod 2 = 0) then write(i:3);

readln;

end.

láobốlaos
31 tháng 3 2023 lúc 16:54

1. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do write(i:3);

readln;

end.

2. Uses crt;

var n,i: integer;

begin clrscr;

readln(n);

for i:=1 to n do if(i mod 2 = 0) then write(i:3);

readln;

end.

Nguyễn Hoàng Duy
2 tháng 4 2023 lúc 16:31

1.

program InDaySoTuNhien;
var n, i: integer;
begin
   write('Nhap so nguyen duong n: ');
   readln(n);

   writeln('Day so tu 1 den ', n, ' la:');
   for i := 1 to n do
      write(i, ' ');
end.

2.

program InSoChan;
var
   n, i: integer;
begin
   write('Nhap so nguyen n: ');
   readln(n);

   writeln('Cac so nguyen chan trong khoang tu 1 den ', n, ' la:');
   for i := 1 to n do
   begin
      if i mod 2 = 0 then
         write(i, ' ');
   end;
end.

Hồng Ánh Nguyễn
Xem chi tiết
namperdubai2
28 tháng 2 2022 lúc 21:25

tham khảo

Đề bài: Viết chương trình tính n! với n là số tự nhiên không âm nhập vào từ bàn phím Để làm được bài này, trước tiên các bạn cần nhớ lại công thức tính n! đã. Theo định nghĩa giai thừa ta có: 0! = 1 n! = 1.2.3…n Vậy là ta có công thức rồi. Nhìn vào công thức ta thấy với n = 0 thì dễ rồi, nếu n > 0 thì nó là tích các số từ 1 đến n.  
Sơn Mai Thanh Hoàng
28 tháng 2 2022 lúc 21:25

TK

Var i ,n : integer;

S , T : real;

Begin

write ('n=') ; read (n) ;

S:= 0;

T:= 1;

For i:= 1 to n do

S:= S + i;

T:= T * i;

Writeln (' Tong cua ' ,n,' so dau tien la' , S );

Writeln (' Tich của ' ,n,' so dau tien la' , T );

Readln;

End.

Nguyễn Huy
Xem chi tiết
𝓗â𝓷𝓷𝓷
4 tháng 5 2022 lúc 8:37

Tham khảo:

program tim_uoc;
uses crt;
var n,i:integer;
begin
clrscr;
write('Nhap n: ');readln(n);
if (n<0) then 
begin
writeln('So nhap vao khong thoa man.');
write('Nhap lai n: ');readln(n);
end;
writeln('Cac uoc so cua ',n,' tu 1 den ',n,' la: ');
for i:=1 to n do
if ( (n mod i) = 0 ) then write(i,'  ');
readln;
end.

Selena
Xem chi tiết
datcoder
3 tháng 2 lúc 13:52

#include <bits/stdc++.h>

using namespace std;

int main(){

    int n;

    for (int i=1; i<=10; i++)

         cout << n <<" x " << i <<" = "<<n*i;

    return 0;

}

nguyễn quốc huy
Xem chi tiết
Nguyễn Lê Phước Thịnh
13 tháng 11 2021 lúc 0:05

#include <bits/stdc++.h>

using namespace std;

string n;

int d;

int main()

{

cin>>n;

d=n.length();

cout<<d;

return 0;

}

Hoàng Thị Mỹ Phan
Xem chi tiết