Haval1

q2

May 1st, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. void dic(node*& head, node*& tail)
  2. {
  3.     int count = 1;
  4.     node* temp = new node;
  5.     temp = head;
  6.     while (temp != NULL)
  7.     {
  8.         if (count == 4)
  9.         {
  10.             temp->data += 20;
  11.         }
  12.         else if(count == 6)
  13.         {
  14.             temp->data += 20;
  15.         }
  16.         temp = temp->next;
  17.         count++;
  18.     }
  19.     temp = head;
  20.     cout << "\n\nprint it\n\n";
  21.     while (temp != NULL)
  22.     {
  23.         cout << "--| " << temp->data << endl;
  24.         temp = temp->next;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment