#include<stdio.h>int s(int x){int i,y; for (i=0;i<x;i++)if(x%i==0)y=0;else y=1;return y;}main(){int x;scanf("%d",&x);if(s(x)==0)printf("%d is a prime\n",x);else printf("%d is not a prime\n",x);return 0;}這哪里錯(cuò)了啊,求指證!
題目:寫一個(gè)判斷素?cái)?shù)的函數(shù),在主函數(shù)輸入一個(gè)數(shù),輸出是否為函數(shù)的信息。
慕粉1255086625
2016-12-24 16:22:33