题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=5138
反着来.
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include <queue>
using namespace std; int main()
{
int a[] = {,,,,};
int n;
while(scanf("%d",&n)!=EOF){
int ans[];
int id = ;
while(id<){
if(n-a[id]<=) break;
ans[id++] = n-a[id];
}
for(int i=id-;i>=;i--){
printf("%d ",ans[i]);
}
printf("%d\n",ans[]);
}
return ;
}