Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Vezba2 {
- public static void odstrani(Red<Integer> r) {
- if(!r.jePrazan()) {
- int br = r.prvi();
- while(br % 4 == 0 && !r.jePrazan()) {
- r.izbaciPrvi();
- br = r.prvi();
- }
- }
- }
- public static void ispisiNaEkran(Red<Integer> r) {
- while(!r.jePrazan()) {
- System.out.print(r.izbaciPrvi() + " ");
- }
- }
- public static void main(String[] args) {
- Red<Integer> brojevi = new Red<Integer>();
- for(int i = 0; i <= 15; i++) {
- brojevi.naKraj(i);
- }
- ispisiNaEkran(brojevi);
- odstrani(brojevi);
- ispisiNaEkran(brojevi);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement