Full 5 câu nhé ^^
A.
Program FNG;
Uses crt;
Var s,e,i: longint;
Begin
Clrscr;
Write('Nhap e: '); Readln(e);
i:=1;
While s<=e do
Begin
s:=s+i;
inc(i);
End;
Write(S);
Readln
End.
B.
Program FNG;
Uses crt;
Var n,d: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
d:=0;
While n<>0 do
Begin
n:=n div 10;
inc(d);
End;
Write(d);
Readln
End.
C.
Program FNG;
Uses crt;
Var n,d: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
d:=0;
While n<>0 do
Begin
d:=d+n mod 10;
n:=n div 10;
End;
Write(d);
Readln
End.
D.
Program FNG;
Uses crt;
Var n,d,k: longint;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
d:=0; k:=n;
While n<>0 do
Begin
d:=d*10+n mod 10;
n:=n div 10;
End;
If d=k then Write('Doi xung')
Else Write('Khong doi xung');
Readln
End.
E.
Program FNG;
Uses crt;
Var n,i: longint;
Function DX(a: longint): boolean;
Var s,k: longint;
Begin
k:=a; s:=0;
While a<>0 do
Begin
s:=s*10+a mod 10;
a:=a div 10;
End;
If s=k then exit(true);
exit(false);
End;
Begin
Clrscr;
Write('Nhap n: '); Readln(n);
For i:=1 to n do
If DX(i) then Write(i,' ');
Readln
End.
Câu C:
uses crt;
var a:array[1..100] of integer;
n,i,s:integer;
begin
clrscr;
write('nhap 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]>0 then s:=s+a[i];
write('tong cac so duong la:',s);
readln;
end
Chờ mình một xíu mình làm tiếp nhé ^^
Tin học, tiếng Anh: informatics, tiếng Pháp: informatique, là một ngành khoa học chuyên nghiên cứu quá trình tự động hóa việc tổ chức, lưu trữ, xử lý và truyền dẫn thông tin của một hệ thống máy tính cụ thể hoặc trừu tượng (ảo). Với cách hiểu hiện nay, tin học bao hàm tất cả các nghiên cứu và kỹ thuật có liên quan đến việc mô phỏng, biến đổi và tái tạo thông tin.
Nguồn : Wikipedia - Bách khoa toàn thưLớp 8 - Năm thứ ba ở cấp trung học cơ sở, học tập bắt đầu nặng dần, sang năm lại là năm cuối cấp áp lực lớn dần nhưng các em vẫn phải chú ý sức khỏe nhé!
Nguồn : ADMIN :))Xem thêm tại https://loigiaisgk.com/cau-hoi or https://giaibtsgk.com/cau-hoi
Copyright © 2021 HOCTAPSGK