Search found 1 match

by lkyip
Sat Oct 16, 2010 4:38 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 319113

What's wrong? #100 - The 3n + 1 problem

import java.lang.*;
import java.util.Scanner;

public class Main {

public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int m = scan.nextInt();
int n = scan.nextInt();
int max = Math.max(m, n);
int min = Math.min(m, n);
int maxCycle = 0;

for(int x=min; x<=max; x ...

Go to advanced search