C++:寻找素数的小程序 改错
谁能帮我修改一下,怎么运行之后出来的结果连我也不知道到底是什么?要是能解释一下为什么会那样子就更好了,谢谢!
尽量帮我修改一下啦,不要重新写的喔……
#include <iostream>
int main()
{

int upl=100;
std::cout<<"This program is used to find the

展开全部
收起
3回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • 键盘手

    15人对此回答表示赞同

    #include <iostream>
    int main()
    {
    int upl=100;
    std::cout<<"This program is used to find the primes between 2 ~ "<<upl<<".\n";
    for (int ini=2;ini <= upl;ini++)
    {
    展开
    15
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • Chenoa

    14人对此回答表示赞同

    首先,你这个不是求素数,是奇数,给你改了。还有,输入函数的位置应该不应该在循环里面是要请注意的,你之所以会输入n个相等的数,就是把输出位置放错了,我觉得书写的格式也要注意,因为这样可以使你的程序更加清析易读,也容易找到错误。
    #include <iostream>
    int main()
    {
    int flag;
    int upl=100;
    std::cout<<"This program is
    展开
    14
    0回复
    发布于 6年前

    评论(0)

    收起评论

  • Eleanor

    3人对此回答表示赞同

    #include <iostream>
    int main()
    {

    int upl=100;
    std::cout<<"This program is used to find the primes between 2 ~ "<<upl<<".\n";

    for (int ini=2;ini <= upl;in
    展开
    3
    0回复
    发布于 6年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部