View Code of Problem 3697

#include<stdio.h>
#include<iostream>
#include<cstring>
using namespace std;
typedef long long ll;
int main(){
		int n;
		int k,s;
		while(scanf("%d",&n)==1){
			while(n--){
				scanf("%d%d",&k,&s);
				int i;
				for(i=k;i<=s;i++){
					int t=2*i;
					int m=4*i;
					printf("%d frogs have %d mouths, %d eyes and %d legs, jump into the water with ",i,i,t,m);
					 
					  for(int j=0;j<i;j++){
	     
					  	if(j==i-1)
					  		printf("splash.\n");
					  	else
					  		printf("splash ");
					  }

				}
			}
		}
		return 0;
	}

Double click to view unformatted code.


Back to problem 3697