goku
BAN USER
int a=2038074743;
int n=1;
int low,high;
low = (6*n)-1;
high = (6*n)+1;
if(a<=3) cout<<"Prime"<<endl;
else
{
while(low<=a)
{
if((a-low) == 0)
{
cout<<"Prime"<<endl;
break;
}
if(high<=a)
{
if((a-high) == 0)
{
cout<<"Prime"<<endl;
break;
}
}
n++;
low = (6*n)-1;
high = (6*n)+1;
}
}
if(low>a)
cout<<"Not Prime"<<endl;
What if you use 2 pointers and make one pointer ahead of another.
-if they are diff., then increment both pointers
-if they are the same, move pointer 2 (the one ahead) and find a value opposite to the pointer 1, then swap with pointer1++. Then put pointer1+=1 and bring back pointer 2 to pointer1++.
-do this until pointer2 has not reached end of list.
Repaileenpankney, photographer at Precious Moments
Confident and dedicated photographer with experience in both professional and freelance photography. I like to explore Black Magic Spell To ...
Repirmajrichh, Junior programmer at AppNexus
I am Irma, seeking the position of a Historical Researcher at Littler’s where my expertise can be utilized to ...
RepLauraJOles, Android Engineer at A9
Hi i am Laura.I live in Us from my childhood and i love my country.My father he is ...
Reptanyamayst, Android Engineer at ABC TECH SUPPORT
I am an experienced project support officer seeking a team focused on excellence and accelerated performance in a BMO company ...
RepEllaFlores, Associate at Alcatel Lucent
Ella , a Tour bus driver in Sounds Great company Inc. A charter bus driver is responsible for providing comfortable and ...
Repsharoneruther, AT&T Customer service email at ABC TECH SUPPORT
I am Sharon, from Bethlehem USA. I am working as a Park naturalist in Sammy's Record Shack company. I ...
Repcarlotamdaniel, abc at ADP
Repjenniferdray9, Accountant at ABC TECH SUPPORT
Hi I am Jennifer D. Ray from san Diego.Currently i am working as a parts salesperson in Rite solution ...
Repabig8485, Apple Phone Number available 24/7 for our Customers at ABC TECH SUPPORT
Hello, I'm Abigail and I'm from Hugo City. I maintain customer loyalty and keep a diverse group of ...
Repbrakpeter2, AT&T Customer service email at Absolute Softech Ltd
My Profession Is photography for a number of years.My Friends were interested in photography, so I was always exposed ...
Repkiaspenill, HTML Experienced at Computer Associates
I am Kia, a skilled cook with 2+ years of experience. Extensive knowledge of the food industry and its relation ...
Repcherylbgrant, Python Experienced at Bankbazaar
Je suis Cheryl, une traductrice multilingue passionnée avec 3 ans d'expérience dans la traduction de différentes langues telles que ...
Repceciliajbaker24, Area Sales Manager at ABC TECH SUPPORT
I work as an Aide at the Alhambra Maker-space, consulting ASU students who come into the space with their projects ...
Repstephiegoblin, Research Scientist at Aristocrat Gaming
Je suis Stephie, une rédactrice associée très créative, organisée et expérimentée, à la recherche d'un poste de direction dans ...
RepLizaZeiger, Animator at Accenture
I am a Loan processing clerk. My work is assembling, administering and processing your loan application paperwork before it gets ...
XOR with 1's
- goku December 03, 2007