2099 整数的尾除(杭电)

//
//  main.c
//  杭州电子科技大学
//
//  Created by yonuyeung on 2021/10/12.
//
#include<stdio.h>
int main()
{
    int a, b;
    while (scanf("%d%d", &a, &b) && (a!=0&&b!=0) )
    {
        int c[100]; int i;
        int t = 0;
        for (i = 0; i <= 99; i++) {
            if ((a * 100 + i) % b == 0) {
                c[t] = i;
                t++;
            }
        }
        for (i = 0; i < t - 1; i++) {
            printf("%02d ", c[i]);
        }
        printf("%02d\n", c[t - 1]);
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_59414507/article/details/120831472