计算a除b的第一位小数 in C++.

my codes:

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int a,b;
    while(~scanf("%d%d",&a,&b))
    {
        int afterdot_1=(a*10)/b;//计算a除b的第一位小数. 
        printf("%d\n",afterdot_1);    
    }
    return 0;    
} 

 

posted @ 2019-08-17 01:05  龙龙666666  阅读(174)  评论(0编辑  收藏  举报