problem description
對於表示式n^2+n+41,當n在(x,y)範圍內取整數值時(包括x,y)(-39<=x
input
輸入資料有多組,每組佔一行,由兩個整數x,y組成,當x=0,y=0時,表示輸入結束,該行不做處理。
output
對於每個給定範圍內的取值,如果表示式的值都為素數,則輸出"ok",否則請輸出「sorry」,每組輸出佔一行。
sample input
0 10 0
sample output
ok
#include using namespace std;
int main()
else
}if(n > 0)
}if(n == 0)}}
return 0;
}
不算坑:判定處不可以用聯等。
HDU 2012 素數判定
problem description 對於表示式n 2 n 41,當n在 x,y 範圍內取整數值時 包括x,y 39 x input 輸入資料有多組,每組佔一行,由兩個整數x,y組成,當x 0,y 0時,表示輸入結束,該行不做處理。output 對於每個給定範圍內的取值,如果表示式的值都為素數,則...
hdu 2012 素數判定
problem description 對於表示式n 2 n 41,當n在 x,y 範圍內取整數值時 包括x,y 39 x input 輸入資料有多組,每組佔一行,由兩個整數x,y組成,當x 0,y 0時,表示輸入結束,該行不做處理。output 對於每個給定範圍內的取值,如果表示式的值都為素數,則...
hdu 2012 素數判定
problem description 對於表示式n 2 n 41,當n在 x,y 範圍內取整數值時 包括x,y 39 x input 輸入資料有多組,每組佔一行,由兩個整數x,y組成,當x 0,y 0時,表示輸入結束,該行不做處理。output 對於每個給定範圍內的取值,如果表示式的值都為素數,則...