Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
![](https://rs.olm.vn/images/avt/0.png?1311)
a)
uses crt;
VAR
n, d, i: integer;
BEGIN
clrscr;
Writeln ('Nhap vao n='); readln (n);
d : = 1;
For i: = 1 to n do
d: = d*i;
Writeln ('d=',d);
Readln;
END.
c)
uses crt;
VAR
n, i, demuoc: integer;
BEGIN
clrscr;
Writeln ('Nhap vao n='); readln (n);
demuoc: = 0;
For i: = 1 to n do
If n mod i = 0 then
demuoc : = demuoc + 1;
If demuoc = 2 then
Writeln ('n la so nguyen to')
ELSE
Writeln ('n khong phai la so nguyen to');
Readln ;
END.
Còn phần b bạn tự nghĩ nha!
Chúc bạn học tốt!
MÀY LÀ MỘT CON CHÓ NGU L NHẤT T TỪNG BIẾT
ĐCM HƯƠNG TRÀ
ĐCM HƯƠNG TRÀ
ĐCM HƯƠNG TRÀ
CÁI J QUAN TRONG NHẮC LẠI 3 LẦN NHA CON ĐĨ NGU
![](https://rs.olm.vn/images/avt/0.png?1311)
var a:Array [1..100] of word;
n,i:byte;
S:word;
begin
write('Nhap so so hang trong day : n = '); readln(n);
for i:=1 to n do begin
write('A[',i,'] = ');
readln(A[i]);
end;
S:=0;
for i:=1 to n do if A[i] mod 2 = 1 then S:=S+A[i];
if S = 0 then write('Trong day khong co so le nao nen khong tong khong ton tai') else write('Tong cac so le trong day la : S = ',S);
readln
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
Bài 1:
function canbac2(x:longint):real;
begin
canbac2:=sqrt(x);
end;
Bài 2:
function tong(n:longint):longint;
var s,i:longint;
begin
s:=0;
for i:=1 to n do
s:=s+i;
tong:=s;
end;
![](https://rs.olm.vn/images/avt/0.png?1311)
Bài 1:
#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<0) and (x%2!=0)) t=t+x;
}
cout<<t;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
program vdd;
uses crt;
var i,n: integer;
begin
clrscr;
write('Nhap N: '); readln(n);
for i:=1 to n do if i mod 2=1 then write(i,';');
readln
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
Program HOC24;
var m,n,i: integer;
t1,t2: longint;
begin
write('Nhap m;n: '); readln(m,n);
t1:=1; t2:=1;
for i:=1 to n do t1:=t1*i;
for i:=m to n do t2:=t2*i;
writeln('T1=',t1);
write('T2=',t2);
readln
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var i,n:integer;
s:longint;
begin
clrscr;
write('nhap n:');readln(n);
s:=2021;
for i:=1 to n do
s:=s+i;
writeln('s=', s);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
double s,a;
int i,n;
int main()
{
cin>>a;
s=0;
n=0;
while (s<=a)
{
n=n+1;
s=s+1/(n*1.0);
}
cout<<n;
return 0;
}
Lời giải :
program hotrotinhoc;
var s: real;
i,n: integer;
begin
readln(n);
s:=0;
for i:=1 to n do
if n mod 2=1 then s:=s+i;
if n mod 2=0 then s:=(n+1)/2;
write(s:1:0);
readln
end.
cô ơi chỗ for thiếu begin kìa cô