Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* OR_Tutorijal_1 Zadatak_7_3 */
- #include <stdio.h>
- int main()
- {
- double pMT, pVT, cMT, cVT, potrosnja=0, uMT, uVT, racun=0;
- printf("Unesite potrošnju el. energije u kWh pri maloj tarifi (MT) i velikoj tarifi (VT): ");
- scanf ("%lf %lf", &pMT, &pVT);
- printf("Unesite cijenu el. energije po kWh za malu tarifu i veliku tarifu: ");
- scanf ("%lf %lf", &cMT, &cVT);
- potrosnja = pMT + pVT;
- uMT=(pMT/potrosnja)*100.f;
- uVT=(pVT/potrosnja)*100.f;
- racun = pMT*cMT + pVT*cVT;
- printf("Ukupna potrosnja je %.2f kWh \n", potrosnja);
- printf("Udio male tarife u ukupnoj potrosnji je: %.2f%% \n", uMT);
- printf("Udio velike tarife u ukupnoj potrosnji je: %.2f%% \n", uVT);
- printf("Iznos racuna je %.2f KM \n", racun);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement