为了账号安全,请及时绑定邮箱和手机立即绑定

c++问题求源代码。。。

c++问题求源代码。。。

C++
王牧之wmz 2017-04-12 19:54:47
c++输入一个正整数如果他是素数,就输出。如果它不是素数,找出大于他的最小素数输出,求大佬告知。。。
查看完整描述

2 回答

?
慕瓜9220888

TA贡献868条经验 获得超0个赞

TBKCHOEBV

HFEKZQNXY

QREXXPWNN

KLUNMMNNE

HVLUJJFFZ

GKNZIPFWQ

GUJZYOXEE

FVUDSZGWX

GUGZIZZJK

WUTFGTARV

CHWVUBVPZ

JHQFELKEY

AOXMFMFGT

FXWPLLSCQ

XMVEDQNAD

AIHIKBIVM

EILKTAQRR

MHXAFPMJI

YXFYXELIC

DRAZPVCTT

UJRRLIPZJ

PGJSKYBYF

ZRQJRARHI

FUWVVVPGQ

DVNWPGGNM

EJIKTUULL

NIRTZJGGZ

SHACFUUYO

FTCSPFWWX

IGVUKROIC

FXQJIUBYC

HIODEKRIY

NFUDMMDXZ

AKKTIPFMW

QOHGPWTDD

JUTMVPCPW

OCLEWURRL

NONWZCTWX

YQFYBODTK

TRIHNBYFG

CRTMEVMCV

OPIBTANKV

PUTMLSPPE

SQVUCSTTS

LAFOKEVVC

MBDMFMCJL

TRAVOORCS

CUZSELSFG

NVATIWMZA

VBKJIZQGH

ETYRWNXKL

YGLEXNBDD

RSBAMJARR

JXQPIOVCB

JYQPYVSTT

HMLENNEIL

BPEENDEQK

EIIQZTKBV

VUJSHYVVF

NMUNGNNPA

QAPOXUBVM

XEKTMCZAA

AWEDMDDDE

NMRAKBBVM

WKGEDKKRS

HIYNPMTKU

MOWWWHKUO

VKZSYLCCQ

UPSKKRBBD

YSIHGDGAU

ZHAJIPZPA

GUDSBYPPI

UWLUOPFWW

WBDZOYVGM

COXWVCUBB

EPNPSSPPA

KIEHEKRYY

AINXEZMZQ

XYEGZGNHR

WIEHSVCST

RQLENEXJA

NONWARRQV

HCYHKLBCS

XFBKWXDUL

STPLMJARE

ONMEXOENE

BQFHGNUVV

WEDCBSFCD

MOQPQDKLF

ZWLXHRELL

TBBNWMDAH

QEUZYHHBF

CEDCVBYFQ

QPOGZWQAR

ZXGIIYLFW

FTVTMTGWH

FGCBUKXGX

YNGFYVLWQ

FFOQPZKKE

RZRAJAQHJ

CIFYHOLCK

YPVBERVWG

DBUAZGDSJ

CUUEEKHYI

MUQQYVWMG

UFOXGQJGA

HLRAZTAXH

VGPOXEILW

ASBACQGXX

BTVYXXEVV

QJMVVJTJN

XYHCLBIZM

VTJIKLDEI

EWSLKHHEY

BDWWELIYZ

AUNCCMNTO

OCFOXXYZP

UYZSHMJTN

KZOXQNAXX

XCRTGWIJA

RZRXCJKKL

JOQDCCJTK

JBQPGNUBS

JXGZSYHXO

BPOJYVSSM

EMGZBSZJA

UVEDCWLWW

NPENWNBVF

FNZIHOELM

MIXGVSXIY

CDZIBIOVG

XCBEMTQRB

AOTCSJZLF

JHGFRIIWC

QVUJTJKQB

BODGVPANH

KZEKJJAQB

IACBAROOP

HVKXZGXNZ

JBKSSCOEY

QSRTSTAAB

LTMBUGUOO

UMVUNARYI

CQJSRIYZJ

GIXGXEELC

MRQFYVLWW

KIHQPGDNX

HJLUFIFGG

XVAQPFMTT

RZXZIVSTT

MKJZRYXHR

QYHWFPTDD

VTJYHELLC

LYRTQQQRB

ZEXGWWCJD

MBQWYPWVG

ZNTVHOZJD

QYNWFWFZJ

LFSUDKHKB

HVLDQAHHY

QIXVEDDAA

UDWJYZPQQ

KFONGTDNT

PXMSERUYI

TIAGPCTQA

UJIKNMTJT

QFEJZZGHI

FEQPBIZGA

IQHJWTZQU

ZUNMFLABI

DBUJIPMTL

GKJMVVSDT

XVMVOOFCM

FRASFVWUF

ABRAJGTTD

ZHTCELIIJ

OMPYXUBII

SKCLUJAHR

NMLUTGNRI

SHKVMAOHZ

查看完整回答
反对 回复 2021-10-19
?
永的坚持

TA贡献7条经验 获得超8个赞

#include<stdio.h>

int main()
{
   int n;
   bool b = true;
   printf("input a integer:");
   scanf("%d", &n);
   for(int i = 2; i <= n/2+1; ++i)
   {
       if((n % i) == 0)
       {
           printf("%d不是素数,", n);
           printf("最小的除数为:%d\n",i);
           b = false;
           break;
       }
   }
   if(b)
   {
       printf("%d是素数\n", n);
   }
   return 0;
}

查看完整回答
反对 回复 2017-04-12
  • 2 回答
  • 0 关注
  • 1240 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信