fork download
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3. int main(){
  4. int n;long long c;
  5. scanf("%lld",&c);
  6. c=n*n/2;if(n&1) c++;
  7. printf("%lld\n",c); bool f;
  8. for(int i=1;i<=n;i++){f=(i&1);
  9. for(int j=0;j<n;j++){ if(f) printf("*");
  10. else printf("x");f=!f;}
  11. printf("\n");}return 0;}
Success #stdin #stdout 0s 9432KB
stdin
1
stdout
0