Sie sind auf Seite 1von 1

#include<iostream>

#include<conio.h>
using namespace std;
int main ()
{
int cont,cont1=0;
cout<<"Los numeros primos que cumplen dicha condicion son:\n";
for(int x=100;x<1000;x++)
{
int cont=0;

for(int n=1;n<=x;n++)
if(x%n==0)
cont++;
if(cont==2)

if(x%10+x/100+(x/10)%10==4||x%10+x/100+(x/10)%10==9||x%10+x/100+(x/10)%10==16||x
%10+x/100+(x/10)%10==25){

cout<<x<<" \n ";
cont1++;
}
}
cout<<"La cantidad de numeros que cumplen dicha condicon es:\n";
cout<<" "<<cont1<<" ";

getch();
}

Das könnte Ihnen auch gefallen