文章
2
粉丝
121
获赞
5
访问
5.7k
 
#include <iostream>
#include<cstdio>
#include<string>
using namespace std;
int main()
{
    string A;
    int B;
    while(cin>>A>>B)
    {
        int Q,R;
        Q=(A[0]-'0')/B;
        if(A.length()==1||A.length()>1&&Q!=0)
            printf("%d",Q);
        R=(A[0]-'0')%B;
        for(int i=1;i<A.length();++i)
        {
            Q=(R*10+A[i]-'0')/B;
            if(Q!=0)
            printf("%d",Q);
            R=(R*10+A[i]-'0')%B;
        }
            printf(" %d\n",R);
  &nbs...
登录后发布评论
暂无评论,来抢沙发