int SG(int x) { //x为大于等于2的整数


int i=2;


while(i*i<=x) {


if(x%i==0) break;


i++;


}


if(i*i<=x) return 0; else return 1;


}
出自:国家开放大学C语言程序设计