DWITE '07 R1 #1 - Vanilla Primes

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
DWITE Online Computer Programming Contest, October 2007, Problem 1

In mathematics, a prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example: 2, 3, 5, 7, 11, 13, 17, 19 are the first eight prime numbers. A vanilla flavour programming problem is to figure out if a given number is a prime or not.

The input will contain a single integer. -1000 \le N \le 1000.

The output will contain a single line, stating if the supplied integer is prime or not.

Sample Input 1


Sample Output 1


Sample Input 2


Sample Output 2


Sample Input 3


Sample Output 3


Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) Problem Resource: DWITE


There are no comments at the moment.