fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int i,j,cnt,n;
  7. cin>>n;
  8. for(i=1;i<=n;i++){
  9. for(j=1;j<=i;j++){
  10. if(j%2==0||i%2==0) cnt++;
  11. }
  12. }
  13. cout<<cnt;
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5288KB
stdin
5
stdout
9