Cod sursa(job #2129882)
Utilizator | Data | 13 februarie 2018 10:44:55 | |
---|---|---|---|
Problema | A+B | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<fstream>
#include<cstdint>
int main() {
int32_t a, b;
std::ifstream{"adunare.in"} >> a >> b;
auto sol{0};
while (a > 0) {
sol = sol - (-2);
a = a - 1;
}
while (b > 0) {
sol = sol - (-2);
b = b - 1;
}
auto half{sol/2};
while (half > 0) {
sol = sol + (-1);
half = half - 1;
}
std::ofstream{"adunare.out"} << sol;
}