fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3. int ile_kolor(int k, char kolor) {
  4. if (kolor== 'c')
  5. return k*k/2;
  6. else
  7. return (k*k-1)/2+1;
  8. }
  9. int main() {
  10. cout<<ile_kolor(8, 'c')<<endl;
  11. cout<<ile_kolor(8, 'n')<<endl;
  12. cout<<ile_kolor(9, 'c')<<endl;
  13. cout<<ile_kolor(9, 'n')<<endl;
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
32
32
40
41