PHP Code: #include <iostream> using namespace std; int SoNT(int a) { int dem=0; for(int i=1;i<=a;i++) if(a%i==0) dem++; if(dem==2) return 1; return 0; } void main() { int a,dem=0; cout<<"Nhap vao so a co 5 chu so tu 1--99999: "; cin>>a; while(a!=0) { int t=a%10; if(t!=1) dem+=SoNT(t); a=a/10; } cout<<"Co "<<dem<<" so nguyen to"<<endl; }
Tất cảToánVật lýHóa họcSinh họcNgữ vănTiếng anhLịch sửĐịa lýTin họcCông nghệGiáo dục công dânÂm nhạcMỹ thuậtTiếng anh thí điểmLịch sử và Địa lýThể dụcKhoa họcTự nhiên và xã hộiĐạo đứcThủ côngQuốc phòng an ninhTiếng việtKhoa học tự nhiên
PHP Code:
#include <iostream>
using namespace std;
int SoNT(int a)
{
int dem=0;
for(int i=1;i<=a;i++)
if(a%i==0)
dem++;
if(dem==2)
return 1;
return 0;
}
void main()
{
int a,dem=0;
cout<<"Nhap vao so a co 5 chu so tu 1--99999: ";
cin>>a;
while(a!=0)
{
int t=a%10;
if(t!=1)
dem+=SoNT(t);
a=a/10;
}
cout<<"Co "<<dem<<" so nguyen to"<<endl;
}
B