0% found this document useful (0 votes)
19 views

Import Java

Uploaded by

Lex Cuchallo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Import Java

Uploaded by

Lex Cuchallo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.util.

*;

import java.lang.*;

import java.io.*;

class prueba

public static void main (String[] args) throws java.lang.Exception

// your code goes here

multRusa c= new multRusa();

System.out.println(c.mult_rusa(3704552519,6984349269));

class multRusa

int mult_rusa(int A, int B) {

if(A==1){

return (B);

if(A%2!=0){

return (B+mult_rusa( A/2 , B*2));

else{

return(mult_rusa( A/2 , B*2));

}
import java.util.*;

import java.lang.*;

import java.io.*;

class prueba

public static void main (String[] args) throws java.lang.Exception

// your code goes here

multRusa c= new multRusa();

System.out.println(c.mult_rusa(3704552519,6984349269));

class multRusa

long mult_rusa(int A, int B) {

if(A==1){

return (B);

if(A%2!=0){

return (B+mult_rusa( A/2 , B*2));

else{

return(mult_rusa( A/2 , B*2));

You might also like