Title: give you the first term of the geometric series and the reciprocal male ratio, the last entry assumes 1 of this series of outputs, otherwise the output boring!.
Analysis: Mathematics. Diminishing. So the countdown to Bowby must be greater than 1. i.e. M > 1.
Then add a condition n > m to infer if the number of bits is 1.
Description: Such a card test instructions the title good Tangled ╮(╯▽╰)╭.
#include <iostream> #include <cstdlib> #include <cstdio>using namespace Std;int data[100];int main () { Long Long N,m;while (~scanf ("%lld%lld", &n,&m)) {if (M <= 1 | | n < m) {printf ("boring!\n"); continue;} int count = 0;while (n%m = = 0 && n >= m) {Data[count + +] = N;n/= m;} Data[count] = n;if (Data[count]! = 1 | | count = 0) printf ("boring!\n"), else {for (int i = 0; i < count; + + i) printf ( "%d", Data[i]);p rintf ("%d\n", Data[count]);}} return 0;}
Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.
UVa 10190-divide, but not Quite conquer!