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.
|