Skip to content
Snippets Groups Projects
Commit fcf1aa65 authored by Kevin Höllring's avatar Kevin Höllring
Browse files

Add tasks to train understanding of c++

parent e249ebe4
No related branches found
No related tags found
No related merge requests found
#include <iostream>
/*
For this task, read in a number n on cin and print out the first n square numbers each in their own line
*/
int main(int argc, char **argv) {
return 0;
}
\ No newline at end of file
#include <iostream>
/*
For this task, read in an integer n on cin and determine whether it is a prime number or not.
Print out "Prime!" (without the apostrophes) if it is a prime number or "Worthless..." (without the apostrophes) otherwise.
*/
int main(int argc, char **argv) {
return 0;
}
\ No newline at end of file
#include <iostream>
/*
For this task, read in a number n on cin and print out the first n numbers of the fibonacci series each in their own line.
The first Fibonacci number is chosen to be 0.
The second Fibonacci number is chosen to be 1.
The i+2'nd Fibonacci number is calculated recursively as the sum of the i'th and the i+1'st Fibonacci numbers.
*/
int main(int argc, char **argv) {
return 0;
}
\ No newline at end of file
#include <iostream>
/*
For this task, read in a number n which will be given as a string of arbitrary length (an integer may not be large enough to store it).
Determine whether the number is a palindrome (the same when read forward or backward) or not.
If so, print out "A man, a plan, a canal -- Panama.", if not print out "Pitiful!"
*/
int main(int argc, char **argv) {
return 0;
}
\ No newline at end of file
#include <iostream>
/*
For this task, read in a number n on cin.
Following that there will be n distinct integers to be read from stdin.
Once these numbers have been read, one more integer k between 0 and n (at most n-1) will be provided.
Print out the k'th largest of the n numbers previously read from stdin
*/
int main(int argc, char **argv) {
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment