Pagini recente » Cod sursa (job #1861755) | Cod sursa (job #1059109) | Cod sursa (job #823648) | Cod sursa (job #1542229) | Cod sursa (job #1045445)
//ttest
#include<iostream>
#include<fstream>
#include<algorithm>
using namespace std;
ifstream fin("loto.in");
ofstream fout("loto.out");
int main(){
unsigned val,i,j,nr,pos1[100],pos2[10000],pos3[1000000],n_pos[3]={0};
short n;
fin>>n; fin>>nr;
for(i=0;i<n;i++){
fin>>val;
pos1[n_pos[0]++]=val;
for(j=0;j<n_pos[0];++j)
pos2[n_pos[1]++]=val+pos1[j];
for(j=0;j<n_pos[1];++j)
pos3[n_pos[2]++]=val+pos2[j];
}
sort(pos3,pos3+n_pos[2]);
for(i=0;i<n_pos[2];i++)
cout<<pos3[i]<<" ";
return 0;
}