We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Laptop Battery Life
Laptop Battery Life
Sort by
recency
|
210 Discussions
|
Please Login in order to post a comment
!/bin/python3
import math import os import random import re import sys
if name == 'main': timeCharged = float(input().strip()) timeLast = timeCharged * 2 if timeLast > 8: timeLast = 8 print(timeLast)
Simple C++ Solution: All Test Case pass int main() { double time; cin >> time; if (time >= 4) cout<<"8.00"; else cout<< time*2;
return 0; }
very easy
8 if timeCharged > 4 else timeCharged*2