4 条题解
-
-2
题解 - 【入门】判断质数 - Hydro body { --font-family: "Microsoft Yahei", "Open Sans", "Seravek", "Segoe UI", "Verdana", "PingFang SC", "Hiragino Sans GB", "Lantinghei SC", "Microsoft Yahei", "WenQuanYi Micro Hei", "sans"; --code-font-family: "Ubuntu Mono", "monaco", "Source Code Pro", "Consolas", "Lucida Console", "monospace"; --font-ligatures: none !important; } #panel { display: flex; flex-direction: column; }1 条题解
-
06 (tyz) LV 5</li>
</span></div> </div> <div class="hasjs--hide"> <form method="post" class="dczcomments__box" name="dczcomments__box__form" data-hotkey="ctrl+enter:submit,esc:vjCommentBoxCancel"> <div> <textarea name="content" class="textbox" data-markdown required></textarea> </div> <div> <input type="submit" class="rounded primary button dczcomments__box__submit" value="分享 (Ctrl+Enter)" data-value-reply="回复 (Ctrl+Enter)" data-value-comment="分享 (Ctrl+Enter)" data-value-comment-update="更新 (Ctrl+Enter)" data-value-reply-update="更新 (Ctrl+Enter)"> <input type="button" class="rounded button nojs--hide" name="dczcomments__box__cancel" value="取消 (Esc)"> </div> <input type="hidden" name="operation" value="submit"> </form> </div> <div class="nojs--hide"> <textarea class="textbox" name="dczcomments__dummy-box" readonly data-form="{"operation":"submit"}" placeholder="发表您的题解"></textarea> </div> <div class="commentbox-placeholder"></div> <ul style="display:none"> <li class="dczcomments__reply commentbox-container"> <div class="media"> <div class="media__body top"> <div class="clearfix"> <div class="supplementary dczcomments__supplementary"> <span class="user-profile-link"> <img class="small user-profile-avatar v-center" loading="lazy" src="//cn.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=mm&s=64" width="20" height="20"> <a class="user-profile-name" href="/user/172"> 6 (tyz) </a>
</div> </div> <div class="commentbox-placeholder"></div> </div> </div> </li> </ul> </div>
0李松辰 (202522249) LV 8 @ 2022-11-15 13:26:59#include<iostream> #include<cmath> using namespace std;
int main(){
</p>int n; int min; bool f;
f=true; cin>>n;
for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ f=false; min=i; break; } }
if(ffalse || n0 || n==1){ cout<<min<<endl; } else { cout<<"Yes"<<endl; }
}
</div> <div class="commentbox-edit-target"></div> <ul class="dczcomments__replies commentbox-reply-target"></ul> </div>
<ul class="pager pager-bottom"><li> <span class="pager__item current">1</span> </li></ul> </div> </div> </div>
题解 - 【入门】判断质数 - Hydro body { --font-family: "Microsoft Yahei", "Open Sans", "Seravek", "Segoe UI", "Verdana", "PingFang SC", "Hiragino Sans GB", "Lantinghei SC", "Microsoft Yahei", "WenQuanYi Micro Hei", "sans"; --code-font-family: "Ubuntu Mono", "monaco", "Source Code Pro", "Consolas", "Lucida Console", "monospace"; --font-ligatures: none !important; } #panel { display: flex; flex-direction: column; }1 条题解
-
06 (tyz) LV 5</li>
</span></div> </div> <div class="hasjs--hide"> <form method="post" class="dczcomments__box" name="dczcomments__box__form" data-hotkey="ctrl+enter:submit,esc:vjCommentBoxCancel"> <div> <textarea name="content" class="textbox" data-markdown required></textarea> </div> <div> <input type="submit" class="rounded primary button dczcomments__box__submit" value="分享 (Ctrl+Enter)" data-value-reply="回复 (Ctrl+Enter)" data-value-comment="分享 (Ctrl+Enter)" data-value-comment-update="更新 (Ctrl+Enter)" data-value-reply-update="更新 (Ctrl+Enter)"> <input type="button" class="rounded button nojs--hide" name="dczcomments__box__cancel" value="取消 (Esc)"> </div> <input type="hidden" name="operation" value="submit"> </form> </div> <div class="nojs--hide"> <textarea class="textbox" name="dczcomments__dummy-box" readonly data-form="{"operation":"submit"}" placeholder="发表您的题解"></textarea> </div> <div class="commentbox-placeholder"></div> <ul style="display:none"> <li class="dczcomments__reply commentbox-container"> <div class="media"> <div class="media__body top"> <div class="clearfix"> <div class="supplementary dczcomments__supplementary"> <span class="user-profile-link"> <img class="small user-profile-avatar v-center" loading="lazy" src="//cn.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=mm&s=64" width="20" height="20"> <a class="user-profile-name" href="/user/172"> 6 (tyz) </a>
</div> </div> <div class="commentbox-placeholder"></div> </div> </div> </li> </ul> </div>
0李松辰 (202522249) LV 8 @ 2022-11-15 13:26:59#include<iostream> #include<cmath> using namespace std;
int main(){
</p>int n; int min; bool f;
f=true; cin>>n;
for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ f=false; min=i; break; } }
if(ffalse || n0 || n==1){ cout<<min<<endl; } else { cout<<"Yes"<<endl; }
}
</div> <div class="commentbox-edit-target"></div> <ul class="dczcomments__replies commentbox-reply-target"></ul> </div>
<ul class="pager pager-bottom"><li> <span class="pager__item current">1</span> </li></ul> </div> </div> </div>
-
- 1
信息
- ID
- 62
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 5
- 标签
- 递交数
- 95
- 已通过
- 40
- 上传者