Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
using namespace std; #define MAX 50 struct covek { string ime; int embr; bool rezultat; bool testiranjeSer; bool testiranjePCR; }; struct Queue { covek niza[MAX]; int front, rear; void init() { front = 0; rear = -1; } bool isEmpty() { if(rear == -1) { return true; } else { return false; } } bool isFull() { if(rear == MAX - 1) { return true; } else { return false; } } void push(covek x) { if(isFull()) { cout << "Redot e poln" << endl; return; } rear++; niza[rear] = x; } covek pop() { if(isEmpty()) { cout << "Redot e prazen" << endl; exit(-1); } covek result = niza[front]; for(int i = front; i < rear; i++) { niza[i] = niza[i + 1]; } rear--; return result; } covek peek() { if(isEmpty()) { cout << "Redot e prazen" << endl; exit(-1); } return niza[front]; } }; void raspredeli_usluzi(Queue lugje, Queue za_rezultati, Queue za_testiranjeSer, Queue za_testiranje_PCR) { while(lugje.isEmpty() == false) { covek c = lugje.pop(); if(c.rezultat == true) { za_rezultati.push(c); } else if(c.testiranjeSer == true) { za_testiranjeSer.push(c); } else if(c.testiranjePCR == true) { za_testiranje_PCR.push(c); } } cout << "Za rezultati: " << endl; while(za_rezultati.isEmpty() == false) { covek c = za_rezultati.pop(); cout << c.ime << " " << c.embr << " e usluzhen za rezultati!" << endl; if(c.testiranjeSer == true) { za_testiranjeSer.push(c); } else if(c.testiranjePCR == true) { za_testiranje_PCR.push(c); } } cout << "Za serolosko testiranje: " << endl; while(za_testiranjeSer.isEmpty() == false) { covek c = za_testiranjeSer.pop(); cout << c.ime << " " << c.embr << "e usluzhen za serolosko testiranje!" << endl; if(c.testiranjePCR == true) { za_testiranje_PCR.push(c); } } cout << "Za PCR testiranje: " << endl; while(za_testiranje_PCR.isEmpty() == false) { covek c = za_testiranje_PCR.pop(); cout << c.ime << " " << c.embr << " e usluzhen za PCR testiranje" << endl; } } int main() { Queue lugje, za_testiranjeSer, za_testiranjePCR, za_rezultati; covek pomoshen; char c; int i=1; lugje.init(); za_rezultati.init(); za_testiranjeSer.init(); za_testiranjePCR.init(); while(1) { cout<<"Vnesete podatoci za covek "<
>pomoshen.ime>>pomoshen.embr>>pomoshen.rezultat>>pomoshen. testiranjeSer>>pomoshen.testiranjePCR; lugje.push(pomoshen); cout<
>c; if(c == '.') break; i++; } raspredeli_usluzi(lugje, za_rezultati, za_testiranjeSer, za_testiranjePCR); cout<
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)