#include "stdafx.h"
#include <iostream>
bool primeNumber( int x )
{
return (x==2,3,5,7) ;
}
int _tmain(int argc, _TCHAR* argv[])
{
using namespace std ;
cout << "ENTER ONE DIGIT NUMBER - " ;
int x ;
cin >> x ;
if ( primeNumber )
cout << x << " IS A PRIME NUMBER " <<endl;
else
cout << x << " IS NOT A PRIME NUMBER " << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
请帮助我..每次都是相同的,即'x'是素数..也建议改变......我只是一个初学者所以也建议改进我的代码的方法
c++ ×1