【hdu 2099 整除的尾数】

整除的尾数

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 13580    Accepted Submission(s): 5665


Problem Description
一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢?
 
Input
输入数据有若干组,每组数据包含二个整数a,b(0<a<10000, 10<b<100),若遇到0 0则处理结束。
 
Output
对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输出。同组数据的输出,其每个尾数之间空一格,行末没有空格。
 
Sample Input
200 40 1992 95 0 0
 
Sample Output
00 40 80 15
 
Source
 
Recommend
lcy
 
 
 1 // Project name : 2099 ( 整除的尾数 ) 
 2 // File name    : main.cpp
 3 // Author       : Izumu
 4 // Date & Time  : Sun Jul  8 20:06:14 2012
 5 
 6 
 7 #include <iostream>
 8 using namespace std;
 9 
10 int main()
11 {
12     int n, k;
13     while (cin >> n >> k && n + k)
14     {
15         int tmp = (n * 100) % k;
16 
17         if (tmp != 0)
18         {
19             tmp = k - tmp;
20         }
21 
22         int count = 0;
23         while (tmp < 100)
24         {
25             if (tmp < 10)
26             {
27                 cout << "0";
28             }
29             if (count)
30             {
31                 cout << " ";
32             }
33             count++;
34             cout << tmp;
35             tmp += k;
36         }
37         cout << endl;
38     }
39     return 0;
40 }
41 
42 // end 
43 // ism 
原文地址:https://www.cnblogs.com/ismdeep/p/2581816.html