In addition to compute a b of the first decimal 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;    
} 

 

Guess you like

Origin www.cnblogs.com/dragondragon/p/11367113.html