vicky1997's blog

By vicky1997, history, 7 years ago, In English

I am new to programming and I have visited number of coding sites and I found Codeforces one of the best coding sites on the Internet. Coding rounds like this are so amazing. I really enjoy coding on Codeforces. Thanks a lot for making coding site like this.

Full text and comments »

  • Vote: I like it
  • +19
  • Vote: I do not like it

By vicky1997, history, 7 years ago, In English

I should be off from CodeForces for some days because of exams but I will not. I must Code.Coding Is My Life.

Mah LIFE mah RULES !!!

Happy Coding !!!

Full text and comments »

  • Vote: I like it
  • -24
  • Vote: I do not like it

By vicky1997, history, 8 years ago, In English

  • Hi all !!! *

  • Finding Prime Numbers In A Different Way... *


include<bits/stdc++.h>

using namespace std;

typedef long long int ll;

int isprime(ll n)

{

if(n<=3)

    return 1;

if(n%2==0||n%3==0)

    return 0;

for(ll i=5;i*i<=n;i+=6)

{

    if(n%i==0||n%(i+2)==0)

        return 0;

}

return 1;

}

int main()

{

//ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);

ll N,i;

cout<<"\nEnter the Number N :";cin>>N;

cout<<"\nPrime Numbers <="<<N<<" are : \n";

for(i=2;i<=N;i++)

{

    if(isprime(i))

            {

        cout<<i<<",";

    }

}

return 0;

}


  • If found any corrections please comments... *

  • Help Appreciated... *


Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it