#include <stdio.h>
#include <locale.h>
int ePrimo( int n) {
int a;
for ( a= 2 ; a< n; a++ )
{
if ( n % a == 0 ) {
return 0 ;
}
}
return 1 ;
}
int main( void ) {
int num, q, quantidade;
printf ( "Quantos número deseja ser informado: " ) ; scanf ( "%d" , & quantidade
) ;
for ( q= 1 ; q<= quantidade; q++ )
{
printf ( "Digite um número: " ) ;
printf ( "%d %s.\n " , num
, ePrimo
( num
) ? "É PRIMO" : "NÃO É PRIMO" ) ; }
return 0 ;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxsb2NhbGUuaD4KCmludCBlUHJpbW8oaW50IG4pewogICAgaW50IGE7CiAgICBmb3IgKGE9MjsgYTxuOyBhKyspCiAgICB7CiAgICAgICAgaWYobiAlIGEgPT0gMCl7CiAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgIH0KICAgIH0KCiAgICByZXR1cm4gMTsKfQoKaW50IG1haW4odm9pZCkgewoJaW50IG51bSwgcSwgcXVhbnRpZGFkZTsKCiAgICBzZXRsb2NhbGUoTENfQUxMLCAiUG9ydHVndWVzZSIpOwoKICAgIHByaW50ZiAoIlF1YW50b3MgbsO6bWVybyBkZXNlamEgc2VyIGluZm9ybWFkbzogIik7CiAgICBzY2FuZiAoIiVkIiwgJnF1YW50aWRhZGUpOwoKICAgIGZvciAocT0xOyBxPD1xdWFudGlkYWRlOyBxKyspCiAgICB7CiAgICAgICAgcHJpbnRmICgiRGlnaXRlIHVtIG7Dum1lcm86ICIpOwogICAgICAgIHNjYW5mICgiJWQiLCZudW0pOwoKICAgICAgICBwcmludGYoIiVkICVzLlxuIixudW0sIGVQcmltbyhudW0pPyAiw4kgUFJJTU8iOiAiTsODTyDDiSBQUklNTyIpOwogICAgfQoJcmV0dXJuIDA7Cn0K