| Цитата(Romikgy @ 28.1.2007, 19:37) | | Код | //---------------------------------------------------------------------------
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused #include <iostream.h> void razbor(string &sx, long &x, long &y) { string sz; long i=sx.find('/',0); sz.assign(sx,0,i); x=atoi(sz.c_str()); sz.assign(sx,i+1,sx.length()); y= atoi(sz.c_str()); }
int main(int argc, char* argv[]) { string sx="1/2",sx1="3/4"; long dig[4]; cout<<"First drob M/N\n"; cin>>sx; cout<<"Second drob M/N\n"; cin>>sx1; //*/ razbor(sx,dig[0],dig[1]); razbor(sx1,dig[2],dig[3]); dig[0]*=dig[3]; dig[2]*=dig[1]; if (dig[0]>dig[2]) { cout<<"First > Second\n"; } else { if (dig[0]<dig[2]) { cout<<"First < Second\n"; } else { cout<<"First == Second\n"; } } cin.get(); return 0; } //---------------------------------------------------------------------------
|
|
Извини, но это не подходит. Мне нужно тока на Борладне, иначе я буду послан |