Answers for "convert python code to java using jython"

0

convert python code to java using jython

s=input()

n=int(input())

l=list(input().split())

ans = 0

for i in l:

count=s.count(i) ans+= count*ord(i)

print(ans)
Posted by: Guest on September-25-2021
0

convert python code to java using jython

import math

def isPerfectSquare(x):
    s = int(math.sqrt(x))
    return s*s == x

def isPrime(n):
    if n <= 1:
        return 0
    for i in range(2, n):
        if n % i == 0:
            return 0;
    return 1
    
def solve(n):
    flag = 0
    if isPrime(n):
        if isPerfectSquare(5*n*n + 4) or isPerfectSquare(5*n*n - 4):
            flag = 0
        else:
            flag = 1
    return flag
Posted by: Guest on June-30-2021

Python Answers by Framework

Browse Popular Code Answers by Language