Skip to content

Commit

Permalink
Solve Keanu in clojure
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Nov 21, 2024
1 parent 0f5c3bf commit c673577
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions solutions/beecrowd/3342/3342.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <cstdint>
#include <iostream>

int main() {
int16_t n;
while (std::cin >> n) {
int16_t black_squares = n * n / 2;
int16_t white_squares = black_squares;

if (!(n % 2 == 0)) {
white_squares++;
}

std::cout << white_squares << " casas brancas e ";
std::cout << black_squares << " casas pretas" << std::endl;
}

return 0;
}

0 comments on commit c673577

Please sign in to comment.