Hi there, today we’re gonna talk about “Prime Numbers”.
First, What is a prime number?
An informal definition is any integer greater o equal to 2 that is divisible just by 2 numbers, one and the number itself.
Hi there, today we’re gonna talk about “Prime Numbers”.
First, What is a prime number?
An informal definition is any integer greater o equal to 2 that is divisible just by 2 numbers, one and the number itself.
UPDATE: Sorry i forgot to attach the pptx
, but now is here.
Well in this class we will talk about RECURSION.
The recursion is soo important cause you will use it in a lot of algorithms from searching and sorting to traveling a tree and much more, this is the way you can make your programs a little more smarter than usual.
This is a great book to start on your way to be a competitive programmer, in this book you will find tips to solve some of the common problems that you will find at http://uva.onlinejudge.org/. Also is a great study guide for the ACM contest.
this is the content of this book:
Chapter 1 Fundamental
Concepts
Chapter 2 Game Plan For a Contest
Chapter 3 Programming In C: a Tutorial
Chapter 4 Essential Data Structures for Contest
Chapter 5 Input/Output Techniques
The topics of this class are:
Here you can find the must used I/O functions and how they work (parameters they receive, return values, flags, etc… ), you will see that depending on the problem your facing, you need to read the input in a different way and the same for the output. If you know the difference between the functions you can choose witch one to use for that case.
This is the main page
The first thing you most do is create your own account. Click in the “Register” link as in the image above.
Then you most fill out the fields.
Example
Sorting:
In many problems you’ll need to sort, an array of any type. Fortunately for you the the C standard library has a built-in function named qsort. As you can guess, this function is an implementation of the algorithm quick sort. The function take 4 parameters.
The function doesn’t return anything.
This is the prototype:
void qsort ( void * base, size_t num, size_t size, int ( * comparator ) ( const void *, const void * ) );
Here an little example of how to use the function qsort:
This is the most critical part of a program, if you cant receive the input rigth the you are dead.
There are a lot of ways the can send you the input, every problem has his answer, now im going to solve some of them:
Most of the time when you are programming and then output is not the one that you expected and you are trying to find your mistake, one helpful way to do this is to use freopen in your main function to use a file like keyboard input and this makes the debugging work easier, then you just have to watch your variables and try to find the error.
**Example: freopen(“input.in”, “r”, stdin);
**Tip: You can also use freopen(“outpu.out”, “w”, stdout) to send the output to a file.