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.

Bài 2:
Program HOC24;
var a: array[1..200] of integer;
i,d,n: integer;
begin
write('Nhap so phan tu N: '); readln(N);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
for i:=1 to n do if a[i] mod 3=0 then d:=d+1;
write('Co ',d,' phan tu chia het cho 3');
readln
end.
Bài 3:
Program HOC24;
var a: array[1..30] of integer;
i,d,n: integer;
begin
write('Nhap so phan tu N: '); readln(N);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
d:=1;
for i:=1 to n do if a[i] mod 2=0 then d:=d*a[i];
write(Tich cac phan tu chia het cho 2 la: ',d);
readln
end.

def generate_sequence(n):
"""Generates the sequence A up to the nth term."""
if n < 0:
return "Please enter a non-negative number."
sequence = [] # This list will hold our sequence
if n >= 0:
sequence.append(1) # A[0] = 1
if n >= 1:
sequence.append(3) # A[1] = 3
for i in range(2, n + 1):
# Calculate A[i] using the rule: A[i] = A[i-1] * 2 * A[i-2]
next_term = sequence[i - 1] * 2 * sequence[i - 2]
sequence.append(next_term)
return sequence
# Let's see the sequence up to the 5th term (A[0] to A[5])
result = generate_sequence(5)
print(result) # Output: [1, 3, 6, 36, 432, 31104]

#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
int a[n][n];
for (int i=0; i<n;i++)
for (int j=0;j<n;j++)
a[i][j]=0;
for (int i=0; i<n;i++){
for (int j=0;j<n;j++)
cout << a[i][j];
cout <<endl;
}
return 0;
}
# Initialize a 2D array with zeros a = [[0 for _ in range(n)] for _ in range(n)]
# Print the 2D array for row in a: print(" ".join(map(str, row)))

uses crt;
var a,b,c,d,tb:real;
begin
clrscr;
write('Nhap diem cua ban:'); readln(a,b,c,d);
tb:=(a+b+c+d)/7;
if tb>=8 then writeln('Gioi');
if (6,5<=tb) and (tb<8) then writeln('Kha');
if (5<=tb) and (tb<6,5) then writeln('Trung Binh');
if tb<5 then writeln('Yeu');
readln;
end.
Bài 10:
uses crt;
var a,b:array[1..10000]of longint;
i,n,dem,j,dem1:longint;
kt:boolean;
begin
clrscr;
readln(n);
for i:=1 to n do readln(a[i]);
dem:=0;
b[1]:=a[1];
for i:=1 to n do
begin
kt:=true;
for j:=1 to dem do
if b[j]=a[i] then kt:=false;
if kt=true then
begin
dem:=dem+1;
b[dem]:=a[i];
end;
end;
writeln(dem);
for i:=1 to dem do
begin
dem1:=0;
for j:=1 to n do
if b[i]=a[j] then dem1:=dem1+1;
writeln(b[i],' xuat hien ',dem1,' lan');
end;
readln;
end.
mình cảm ơn nhiều ạ