Code Monkey home page Code Monkey logo

cp_snippets's Introduction

CP_Snippets

A One Stop Place to find many useful Snippets for competetive programming

Contribution Procedure

  • Raise an issue about the snippet you want to make in the following format: File Name: YourFileName.xx (PascalCase name is compulsory, Example) Description: 2 to 5 lines of what the snippets performs
  • You will be assigned the issue, Then You can create a Pull Request Whose code follows the conduct belo
  • your Snippet should be short and formatted, use minimal boilerplate, and use the format giver below
  • Don't Forget to include your username, Description of code and Date of creation of your code

Example Filename: PrimeCheck.cpp Snippet:

/* 
------------------------------------------------------------------------------------------------
USERNAME: RASESH2005
DESCRIPTION: THIS PROGRAM CHECKS IF A NUMBER IS PRIME OR NOT
DATE: 1/10/2021
------------------------------------------------------------------------------------------------
*/
#include <bits/stdc++.h>

using namespace std;

//SNIPPET
bool isPrime(int n)
{
    for (int i = 2; i <= int(sqrt(n) + 1); i++)
    {
        if (n % i == 0)
            return false;
    }
    return true;
}
int main()
{
    //APPLICATION
    bool result = isPrime(24498757);
    cout << result << endl;
    cout << (result ? "Prime" : "Not A Prime") << endl;
    return 0;
}
  • Drop the file in the respective language folder, If your language folder is absent make a new folder with your language name
  • Make a PR Addressing the issue you made That was assigned to you.
  • You will receive a response soon

Thank You for contributing

Thank You

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.