Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct nod
- {
- int info;
- nod* leg;
- };
- int main()
- {
- int n, a, r;
- cin >> n >> a >> r;
- nod* prim = NULL;
- nod* p;
- for(int i = 1; i <= n; i++)
- {
- p = new nod;
- p -> info = a + (n-1)*r;
- p -> leg = prim;
- prim = p;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment