View Code of Problem 3697

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<climits>
#include<cmath>
#include<map>
#include<set>
#include<queue>

using namespace std;


int main()
{
	int n;
	cin >> n;

	for (int i = 0; i < n; i++) {

		int k, s;
		cin >> k >> s;

		if (k > s)
			swap(k, s);

		for (int j = k; j <= s; j++) {

			cout << j << " frogs have " << j << " mouths, " << j * 2 << " eyes and " << j * 4 << " legs, jump into the water with ";

			for (int z = 0; z < j; z++) {

				cout << "splash";

				if (z != j - 1)
					cout << " ";
				else
					cout << ".";
			}
			
			cout << endl;
		}
	}
}

Double click to view unformatted code.


Back to problem 3697