View Code of Problem 3697

package com.zucc.problem3697;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int N=scanner.nextInt();
		for(int i=0;i<N;i++) {
			int  K=scanner.nextInt();
			int S=scanner.nextInt();
			if (K>S) {
				int temp=K;
				K=S;
				S=temp;
			}
			for (int j = K; j <= S;j++) {
				System.out.printf("%d frogs hava %d mouths, %d eyes and %d legs,jump into the water with",j,j,j*2,j*4);
				for (int j2 = 0; j2 < j; j2++) {
					System.out.print(" splash");
				}
				System.out.println(".");
			}
		}
	}
}

Double click to view unformatted code.


Back to problem 3697