| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11182 | primes |
|
| 11183 | The Longest Palindrome - partial |
|
Description
Given a integer number N, print out all the primes less than N
In this problem, your ONLY need to implement a function called isPrime(int n).
It returns 1 if the number is prime, otherwise returns 0.
Main program is below. It calls the function you implement and print out the results.
Input
There is only a integer N. (N<=1000)
Output
All the primes less than N in ascending order, each prime a line.
Sample Input Download
Sample Output Download
Partial Judge Code
11182.cppPartial Judge Header
11182.hTags
Discuss
Description
A palindrome is a string that is identical to its reverse, like "level" or "aba". In this problem, some strings are given, and the longest palindrome in each string should be computed.
This problem involves three files:
1. 11183.c: the source file containing the main function and calls ispal().
2. 11183.h: the header file that gives the prototype of function ispal().
3. your answer as a C source file, in which you should implement the ispal() function to determine whether a given string is a palindrome or not.
Please check the provided files for details.
Input
The input consists of multiple lines, and each of them is a string that contains alphabets and numbers.
The length of each string is less than 1000 and larger or equal to 1.
The number of lines is less than or equal to 100.
Output
The longest palindrome in each string should be outputted.
If there are many palindromes of the same length, output the first one in the string.