题目链接:
反着来.
#include#include #include #include #include #include using namespace std;int main(){ int a[5] = { 1,2,4,7,15}; int n; while(scanf("%d",&n)!=EOF){ int ans[5]; int id = 0; while(id<5){ if(n-a[id]<=0) break; ans[id++] = n-a[id]; } for(int i=id-1;i>=1;i--){ printf("%d ",ans[i]); } printf("%d\n",ans[0]); } return 0;}