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
import math def dali_e_prost(x): for i in range(2, int(math.sqrt(x) + 1)): if x % i == 0: return False return True def e_palindrom(x): s = str(x) if s == s[::-1]: return True return False def main(): n = int(input()) niza = [] for i in range(0, n): x = int(input()) niza.append(x) prosti = 0 slozheni = 0 palindromi = 0 for i in range(0, n): if dali_e_prost(niza[i]): prosti += 1 else: slozheni += 1 if e_palindrom(niza[i]): palindromi += 1 print(f"Prosti: {prosti}") print(f"Slozheni: {slozheni}") print(f"Palindromi: {palindromi}") if __name__ == "__main__": main()
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)