14084 - Prime Check Function   

Description

給定主要執行程式main.c (題號.c)、以及Header檔function.h (題號.h);請試著完成Header檔中未實現的函式:primeCheck()

 

Methods:

- int primeCheck(int num) – 檢查傳入參數*num是否為質數,若*num是質數則回傳1,反之則回傳0

 

#include "function.h"

int primeCheck(int num) {

  // TO DO                                                                                                                                                                                                 

}

Input

*array

 

Note:

  1. 無需處理輸入

  2.  *array為整數陣列,共含10個相異正整數*n1, *n2, *n3 … , *n10

  3. 1 <= *array[i] <= 2147483647

Output

輸出比須符合以下格式:

  • 陣列中有多個質數:

There are *n primes in the array.

 

  • 陣列中有一個質數:

There is *n prime in the array.

 

  • 陣列中沒有質數:

There isn't any prime in the array.

 

Note:

  1. 無需處理輸出

  2. *n為陣列中的質數個數

Sample Input  Download

Sample Output  Download

Partial Judge Code

14084.c

Partial Judge Header

14084.h

Tags




Discuss