提交时间:2024-06-12 13:32:11
运行 ID: 151157
#include<bits/stdc++.h> using namespace std; int a[205],f[205],cnt,n; bool sushu(int x){ for (int i = 2;i * i <= x;i++)if (x % i == 0)return false; return true; } int main(){ for (int i = 2;i <= 200;i++) if (sushu(i)){ cnt++; a[cnt] = i; } f[0] = 1; f[1] = 0; for (int i = 1;i <= cnt;i++)for (int j = a[i];j <= 200;j++)f[j] += f[j - a[i]]; while (cin>>n)cout<<f[n]<<endl; return 0; }