#include #define MAX 100 using namespace std; int nt(int kiem) { int dem = 0; for (int j = 1; j <= sqrt(kiem); j++) { if (kiem % j == 0) { dem++; } } if (dem == 1) return kiem; } int main() { int n, i, a[MAX], tong = 0; cout << "Nhap so phan tu n: "; cin >> n; for (int i = 1; i <= n; i++) { cout << "Nhap phan tu thu " << i << ": "; cin >> a[i]; if (nt(a[i]) == 1) { tong = tong + nt(a[i]); } } cout << "Tong cac so nguyen to co trong mang la " << tong; }