Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- #include <math.h>
- int main()
- {
- int t, i, j, k, l, a, b, c, d, x, y, z, ar[100];
- char ch, str[100];
- scanf("%d", &t);
- getchar();
- j = 0, l = 0;
- for (i = 1; i <= t; i++)
- {
- ch = getchar();
- if (ch != 100)
- {
- scanf("%d", &ar[l++]);
- getchar();
- }
- else
- {
- if (j >= l) puts("Queue Empty");
- else
- {
- printf("%d\n", ar[j]);
- j++;
- }
- getchar();
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement