View Code of Problem 3697

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