懒得自己改了
#include<iostream>
using namespace std;
int zhi(int x){
if(x==1||x==2) return 1;
for(int i=2;i<x;i++) if(x%i==0) return 0;
return 1;
}
int main(){
int n,z=0,i=2,h=0;
cin>>n;
while(h<n){
if(zhi(i)==1&&h+i<=n){
cout<<i<<endl;
z++;
h+=i;
}
i++;
}
cout<<z;
return 0;
}