Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C by L10_Z4 ( 3 years ago )
#include <stdio.h>
#include <stdlib.h>

struct Vrijeme {
    int sati, minute, sekunde;
};

unsigned int proteklo(struct Vrijeme prvo, struct Vrijeme drugo) {
    return abs((prvo.sati * 3600 + prvo.minute * 60 + prvo.sekunde) - (drugo.sati * 3600 + drugo.minute * 60 + drugo.sekunde));
}

int main() {
    struct Vrijeme prvo, drugo;

    printf("Unesite prvo vrijeme (h m s): ");
    scanf("%d %d %d", &prvo.sati, &prvo.minute, &prvo.sekunde);

    printf("\nUnesite drugo vrijeme (h m s): ");
    scanf("%d %d %d", &drugo.sati, &drugo.minute, &drugo.sekunde);

    printf("\nIzmedju dva vremena je proteklo %u sekundi.", proteklo(prvo, drugo));

	return 0;
}

 

Revise this Paste

Your Name: Code Language: