你们主函数:void main(){bool b_sushu;for(int i=100;i<=200;i++){b_sushu=sushu(i);if(b_sushu){cout<<m<<"is a primer"<<endl;}else{cout<<m<<"is not a primer"<<endl; }}} #include<iostream.h>int primer(int m){int i k;k=m/2;for (i=2;i<=k;i++){if (m%i==0)break; }return(i>=(k+1));}void main(){int j;cout<<"there are primer(between 100 to 200):"<<endl; for(j=100;j<=200;j++) if(primer(j)) cout<<j<<" ";} ||| #include <iostream.h>bool sushu(int x);void main( ){ int m=0;bool b_sushu;cin>>m;b_sushu=sushu(m);if(b_sushu){cout<<m<<"is a primer"<<endl;}else{cout<<m<<"is not a primer"<<endl; }} bool sushu(int x){int k=x/2;for (int i=2;i<=k;i++){if (x%i==0)break; }if ( i>=k+1){cout<<m<<"is a primer"<<endl;}else{cout<<m<<"is not a primer"<<endl; }} 答案补充 如果是100-200之间