当前位置:网站首页>Matlab finds a prime number that is greater than a given integer and follows this integer
Matlab finds a prime number that is greater than a given integer and follows this integer
2022-06-30 14:53:00 【Tongxuan Shangjing programmer】
Problem description : Find an integer greater than the given value ( Greater than required 30) And then the prime of this integer , And output as program value .
Go straight to the code :
clc;clear;
n=input(' Please enter n:');
for i=n+1:1e+4
for j=2:i
if(rem(i,j)==0&&i~=j)
break;
elseif(j==i)
fprintf(" Followed by Prime %d\n",i);
return ;// It's the following , Not all !
end
end
endBe careful :return It can't be less , Or you can try .
边栏推荐
- Pseudocode writing specification
- JS to realize simple lottery function
- Text matching - [naacl 2021] augsbert
- Experiment 2: stack
- XSS challenge (6-10) more detailed answers
- [extensive reading of papers] sentimental analysis of online reviews with a hierarchical attention network
- XSS challenge (1-5) more detailed answers
- 【BUUCTF】[GXYCTF2019]Ping Ping Ping1
- ThinkPHP show method parameter controllable command execution
- 2021-07-15Caused by: org. quartz. ObjectAlreadyExistsException: Unable to store Job : ‘DEFAULT. TASK_ 1‘
猜你喜欢

Ctfshow getting started with the web (ThinkPHP topic)

CCF Z-scan (full mark code + problem solving ideas) 201412-2

V3 03_ Getting started

Shift operator (detailed)
![[geek challenge 2019] PHP problem solving record](/img/bf/038082e8ee1c91eaf6e35add39f760.jpg)
[geek challenge 2019] PHP problem solving record

Lihongyi machine learning 2020 homework summary

@PathVariable

CCF access control system (Full Score code + problem solving idea) 201412-1

2021-05-12

Knowledge learned from the water resources institute project
随机推荐
catkin_ Make reports an error, transfers the location of the workspace, and uses other people's workspace files to cause compilation errors
jsPlumb. Deleteeveryconnection is not a function & jsplumb clear canvas jsplumb delete all nodes and all connections
CCF adjacent number pairs (Full Score code + problem solving ideas + skill summary) 201409-1
Thinkphp5 log file contains trick
Att & CK red team evaluation field (I)
Experiment 2: stack
How to realize selective screen recording for EV screen recording
机械工程师面试的几个问题,你能答上来几个?
Upgrade composer self update
LIS error: this configuration section cannot be used in this path
ES6 notes
V3_ Chrome extended Chinese translation document V3 directory
Lost connection to the flow server (0 retries remaining): |Out of retries, exiting! Error reporting solution (flow)
中信期货开户麻烦吗安全吗,期货开户手续费是多少,能优惠吗
Sum of CCF digits (full mark code + problem solving idea) 201512-1
Ctfshow getting started with the web (ThinkPHP topic)
2021-08-05 leetcode notes
这种零件该怎么编程加工?
Analysis on the problems of irregular step hole on horizontal machining center
2021-07-14 mybaitsplus