-
-
Save veigavitor/26ce79ebe872ba18a43c85c08d443eec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int32_t main() { | |
ios::sync_with_stdio(false); | |
cin.tie(nullptr); | |
// lemos a entrada | |
int l, m; | |
cin >> l >> m; | |
// a nova capacidade máxima será 30% da antiga | |
// note que queremos somente a parte inteira da nova capacidade. Assim, podemos | |
// declarar 'n' como int, e a retirada da parte decimal será feita automaticamente | |
int n = 0.3 * l; | |
// caso 'n' seja menor que 'm', retornamos 0, se não, retornamos 'n' | |
if(n < m) { | |
cout << 0 << endl; | |
} else { | |
cout << n << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment