#include <algorithm> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <set> #include <stack> #include <string> #include <vector> using namespace std; int main(void) { int n; scanf("%d", &n); while (n--) { int a, b; scanf("%d %d", &a, &b); if (a < b) { while (a <= b) { printf("%d frogs have %d mouths, %d eyes and %d legs, jump into the water with", a, a, a * 2, a * 4); for (int i = 0; i < a; i++) printf(" splash"); printf(".\n"); a++; } } else { while (b <= a) { printf("%d frogs have %d mouths, %d eyes and %d legs, jump into the water with", b, b, b * 2, b * 4); for (int i = 0; i < b; i++) printf(" splash"); printf(".\n"); b++; } } } } |
Double click to view unformatted code.