Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Количество пар кр и не кр 11 оптимизированное с логикой
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//fpc 3.0.0 program HelloWorld; const delta = 1; var n, i, s, s11, sn, x : integer; m : array [0..delta] of integer; begin s := 0; s11 := 0; sn := 0; readln (n); for i := 0 to delta do begin readln (x); m[i] := x end; for i := delta + 1 to n - 1 do begin readln (x); if (m[0] mod 11 = 0) and (x mod 11 = 0) then begin s11 := s11 + 1; s := s + s11 + sn end else if (m[0] mod 11 <> 0) and (x mod 11 = 0) then begin sn := sn + 1; s := s + s11 + sn end else if (m[0] mod 11 = 0) and (x mod 11 <> 0) then begin s11 := s11 + 1; s := s + s11 end else if (m[0] mod 11 <> 0) and (x mod 11 <> 0) then begin sn := sn + 1; s := s + s11 end; { if m[0] mod 11 = 0 then s11 := s11 + 1 else sn := sn + 1; readln (x); if x mod 11 = 0 then s := s + s11 + sn else s := s + s11; } m[0] := m[1]; m[1] := x; end; writeln(s); end.
Show compiler warnings
[
+
]
Show input
edit mode
|
history
|
discussion