搜索
查看: 482|回复: 4
打印 上一主题 下一主题

cpc_Does anyone can answer this problem?

[复制链接]
跳转到指定楼层
楼主
发表于 2018-3-26 21:19:45 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
20啊哈币
Does anyone can answer this problem?


Does anyone can answer this problem?

Does anyone can answer this problem?

It's so important that it should be repeated for three times.

Does anyone can answer this problem?

最佳答案

查看完整内容

#include using namespace std; bool prime(int n) { for(int i=2;i>n; for(int i=2;i0&&n-i>=i)) cout
沙发
发表于 2018-3-26 21:19:46 | 只看该作者
#include<iostream>
using namespace std;
bool prime(int n)
{
    for(int i=2;i<n/2+1;i++)
        if(n%i==0)
            return false;
    return true;
}
int n;
int main()
{
    cin>>n;
    for(int i=2;i<=n;i++)
        if(prime(i)&&prime(n-i)&&(n-i>0&&n-i>=i))
                cout<<n<<"="<<i<<"+"<<n-i<<endl;
    return 0;
}

板凳
 楼主| 发表于 2018-3-26 21:49:32 | 只看该作者
这是题目
这是题目
这是题目
这是题目
这是题目
这是题目
这是题目

hehehe.PNG (158.14 KB, 下载次数: 15)

hehehe.PNG

hehehe.rar

157.54 KB, 下载次数: 1

地板
发表于 2018-4-1 11:43:27 | 只看该作者
这题目太水沝淼了,没难度啊

点评

你牛。  发表于 2018-4-1 12:30
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表