Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #define N 5
  5. int queue[N];
  6. int ip;
  7. int rp;
  8.  
  9. void qinsert(int ak){
  10.     if(ip==N)
  11.         puts("oura pliris");
  12.     else
  13.         queue[ip++]=ak;        
  14. }
  15. int qremove(){
  16. int data;
  17.     if (ip==rp){
  18.         puts("oura keni");
  19.         return -1;
  20.     }
  21.     else {
  22.         data=queue[rp++];
  23.         return data;
  24.     }
  25. }
  26.  
  27.  
  28.  main() {
  29. int ch;
  30. int ak;
  31. int i;
  32. int apot;
  33.    
  34. puts("dwse xaraktira");
  35. gets(ch);  
  36. if(ch=="U" || ch=="O" || ch=="E" ){
  37.     if(ch=="U"){
  38.         puts("dwse akeraio");
  39.         gets(ak);
  40.         qinsert(ak);
  41. }  
  42.     else if (ch=="O")
  43. {
  44.         apot=pop();
  45. }  
  46.     else  (ch=="E")
  47.     {
  48.         for(i=0;i<N;i++){
  49.             puts(queue[i]);
  50.     }
  51. }      
  52. }
  53. else{
  54.     puts("lathos xaraktiras");
  55.     ]
  56.  puts(queue[i]);   
  57.     return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement