← Back to List

10474번: 분수좋아해? ↗

Solutions

C++14
313 B | 313 chars
#include <iostream>
using namespace std;
int a,b;
int main()
{
    while(1)
    {
        cin>>a>>b;
        if(a==0&&b==0) return 0;
        cout<<a/b<<" ";
        if(a%b==0) cout<<"0 / "<<b;
        else
        {
            a=a%b;
            cout<<a<<" / "<<b;
        }
        cout<<endl;
        
    }
}