F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_13726000_4934.cpp:1:1063: fatal error: GCC4.9.2/lib/gcc/x86_64-w64-mingw32/4.9.2/include/iostream>usin: Invalid argument
 #include <iostream>using namespace std;int f(int u,int v){    while(u%v)    {      int w=u%v;      u=v;      v=w;    }    return v;}int main(){    int t;    while(cin>>t)    {        while(t--)        {            char a[15];            cin>>a;            int p=0,q=0,t=0,x=0,y,k=1,l=1,max;            for(int i=2;a[i]!='\0';i++)            {                if(!t && a[i]!='(') {p++;x*=10;x+=a[i]-'0';}                if(t && a[i]!=')') {q++;y*=10;y+=a[i]-'0';}                if(a[i]=='(') {t=1;y=x;q=p;}            }            if(!q)            {                while(p--)                    k*=10;                max=f(x,k);                x/=max;                k/=max;                cout<<x<<'/'<<k<<endl;            }            else            {                int m=y-x;                while(p--)                    k*=10;                while(q--)                    l*=10;                int n=l-k;                max=f(m,n);                m/=max;                n/=max;                cout<<m<<'/'<<n<<endl;            }        }    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ^
compilation terminated.


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-26 20:47:16, Gzip enabled