Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //zadacha3
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- struct list {
- int x;
- struct list * next;
- };
- void tofront(struct list **p1) {
- int n = 1;
- struct list *we = *p1;
- while (we -> next)
- we = we->next, ++n;
- for (int i = 0; i < n / 3; ++i) {
- we -> next = *p1;
- we = we -> next;
- *p1 = (*p1) -> next;
- }
- we -> next = NULL;
- }
- void print(struct list *t) {
- while (t) {
- printf("%d -> ", t->x);
- t = t -> next;
- }
- }
- int main(void) {
- int x, y;
- printf("%d", (x = 4, y = 5));
- return 0;
- }
Add Comment
Please, Sign In to add comment