Varianta 53 / Subiectul 2 / Problema 5 |
#include<iostream.h> struct nod{ int info; nod* urm; }; nod *prim, *p, *nou; void main() { int n,r,a; cin>>n>>a>>r; prim=NULL; for(int i=n-1;i>=0;i--) { nou=new nod; nou->info=a+i*r; nou->urm=prim; prim=nou; } for(p=prim;p!=NULL;p=p->urm) cout<<p->info<<" "; } |