Problem 13

9 comments on “Problem 13”


  • Gourav

    n=int(input())
    res=0
    temp=n
    lenn=0
    while(temp!=0):
    lenn+=1
    temp=temp//10
    for i in range(lenn):
    res=res*(10)+n%10
    n=n//10
    print(res)


  • Sunny

    n=int(input())
    rev=[]
    for i in str(n):
    rev.append(int(i))
    reverse_final=rev[::-1]
    for i in range(len(reverse_final)):
    print(reverse_final[i],end=””)


  • Raman

    // Online C compiler to run C program online
    #include

    int main() {
    int n,rem,c=0,i=0;
    int a[20];
    scanf(“%d”,&n);
    while(n>0){
    rem=n%10;
    a[i]=rem;
    n=n/10;
    i++;
    c++;
    }
    for(i=0;i<c;i++){
    printf("%d",a[i]);
    }

    return 0;
    }


  • Richik

    PYTHON 3:
    k=0
    i=0
    def rev(n):
    global k
    global i
    if n==0:
    return
    else:
    rev(n//10)
    k+=(n%10)*10**i
    i+=1
    rev(int(input()))
    print(k)


  • Harsha

    def reverse(n):
    str_n=str(n)
    if n<0:
    str_n=str_n[1:]
    str_n=str_n[::-1]
    str_n='-'+str_n
    else:
    str_n=str_n[::-1]
    return int(str_n)
    n=int(input())
    print(reverse(n))


  • avi gehlot

    #python code here
    number =int(input())
    reverse=0
    while number>0:
    remainder=number%10
    reverse=reverse*10+remainder
    number=number//10
    print(reverse)