Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
public class MAin { public static void main(String[] args) { int[][] mat = new int[8][8]; for(int i = 0; i < 8; i++) { for(int j = 0; j < 8; j++) { mat[i][j] = 0; } } int p = 0; for(int i = 0; i < 8; i++) { for(int j = 0; j < 8; j++) { int ci = i, cj = j; while(ci >= 0 && cj >= 0) { // prvata dijagonala, odime levo nagore mat[ci][cj] = 1; ci--; cj--; } ci = i; cj = j; while(ci < 8 && cj < 8) { // dole desno mat[ci][cj] = 1; ci++; cj++; } ci = i; cj = j; while(ci >= 0 && cj < 8) { // gore desno mat[ci][cj] = 1; ci--; cj++; } ci = i; cj = j; while(ci < 8 && cj >= 0) { // dole levo mat[ci][cj] = 1; ci++; cj--; } for(int a = 0; a < 8; a++) { for(int b = 0; b < 8; b++) { if(a != i && b != j && mat[a][b] == 0) { p++; } } } for(int a =0 ; a < 8; a++) { for(int b = 0; b < 8; b++) { mat[a][b] = 0; } } } } System.out.println(p / 2); } }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)