#include<stdio.h> #include<string.h> #include<math.h> #define MAX 1000000+10 #define Max(a,b) a>b?a:b #define Min(a,b) a<b?a:b int main() { int n; scanf("%d",&n); int k[n],s[n]; int i,j,l; for(i=0;i<n;i++) { scanf("%d%d",&k[i],&s[i]); if(k[i]<s[i]) { for(j=k[i];j<=s[i];j++) { if(j==1) { printf("1 frog has 1 mouth, 2 eyes and 4 legs, jumps into the water with a splash.\n"); } else { printf("%d frogs have %d mouths, %d eyes and %d legs, jump into the water with ",j,j,2*j,4*j); for(l=0;l<j;l++) { if(l<j-1) printf("splash "); else printf("splash.\n"); } } } }else{ for(j=k[i];j>=s[i];j--) { if(j==1) { printf("1 frog has 1 mouth, 2 eyes and 4 legs, jumps into the water with a splash.\n"); } else { printf("%d frogs have %d mouths, %d eyes and %d legs, jump into the water with ",j,j,2*j,4*j); for(l=0;l<j;l++) { if(l<j-1) printf("splash "); else printf("splash.\n"); } } } } }} |
Double click to view unformatted code.