1.题目描述:点击打开链接
2.解题思路:先计算小数点后到m位,m应尽可能大;由于周期不会超过分母,故一个个的枚举周期即可,注意周期是否大于50时要单独处理
3.代码:
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<math.h>
#define max 7000
int arr[max];
int main()
{
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
int a, b;
while (scanf("%d %d", &a, &b) == 2)
{
memset(arr, 0, sizeof(arr));
int x = floor((double)a / ......
阅读全文