View Code of Problem 3697

#include<stdio.h>
#include<string.h>
int main()
{
	int t;
	scanf("%d",&t);
	for(int i=0;i<t;i++)
	{
		int k,s;
		scanf("%d %d",&k,&s);
		if(k>s)
		{
			int temp=s;
			s=k;
			k=temp;
		}
		for(int j=k;j<=s;j++)
		{
			printf("%d frogs have %d mouths, %d eyes and %d legs, jump into the water with",j,j,2*j,4*j);
			for(int k=0;k<j;k++)
			{
				printf(" splash");
			}
			printf(".\n");
		}
	}
}

Double click to view unformatted code.


Back to problem 3697