Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #define N 5
- int queue[N];
- int ip;
- int rp;
- void qinsert(int ak){
- if(ip==N)
- puts("oura pliris");
- else
- queue[ip++]=ak;
- }
- int qremove(){
- int data;
- if (ip==rp){
- puts("oura keni");
- return -1;
- }
- else {
- data=queue[rp++];
- return data;
- }
- }
- main() {
- int ch;
- int ak;
- int i;
- int apot;
- puts("dwse xaraktira");
- gets(ch);
- if(ch=="U" || ch=="O" || ch=="E" ){
- if(ch=="U"){
- puts("dwse akeraio");
- gets(ak);
- qinsert(ak);
- }
- else if (ch=="O")
- {
- apot=pop();
- }
- else (ch=="E")
- {
- for(i=0;i<N;i++){
- puts(queue[i]);
- }
- }
- }
- else{
- puts("lathos xaraktiras");
- ]
- puts(queue[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement