网站需要哪些备案,福州做网站价格,乐至建设局网站,南宁百度seo放心选择bLue的除法算术题 Time Limit: 1000MS Memory Limit: 65536KBSubmit StatisticProblem Description bLue 最近接了个重活#xff0c;需要帮助小学生手算大量的除法算术题#xff0c;这可把他累坏了。 但是#xff0c;机智的 bLue 一想#xff0c;写个 “printf(%f需要帮助小学生手算大量的除法算术题这可把他累坏了。 但是机智的 bLue 一想写个 “printf(%f, (double)a/b);” 不就完事了嘛。可是他最近忙得都没空开电脑啦你能帮他写一下吗 Input 输入数据有多组数据组数不超过 20到 EOF 结束。 每组输入两个整数 a, b (1 a, b 2^16) 且保证运算结果一定是有限小数。a, b 同时为 0 时输入结束。 Output 输出 a/b 的运算结果bLue 想要的格式参见示例。 Example Input 1 2
2 4
1 8
8 4
0 0 Example Output 0.5
0.5
0.125
2
#includeiostream
#includecstring
#includecstdio
using namespace std;
int main()
{
int a,b;
int num[20];
while(cinab)
{
if(ab0)
break;
int cnt0;
int ta/b;
a(a%b)*10;
while(a)
{
num[cnt]a/b;
a(a%b)*10;
}
printf(%d,t);
if(cnt0)
{
cout.;
for(int i0;icnt;i)
printf(%d,num[i]);
coutendl;
}
}
return 0;
}