On Apr 25, 2007, at 6:29 PM, Andrei Ursan wrote: > [code] > #include <iostream.h> > #include <conio.h> > > void r_string(int n, int v[]) > { > int i; > > for(i=0;i<n;i++) > { > cout<<"v["<<i<<"]="; > cin>>v[i]; > } > > } > > void p_string(int n, int v[]) > { > int i; > cout<<"\nThe string is : "; > > for(i=0;i<n;i++) > cout<<v[i]<<" "; > > } > > float avarage_string(int n, int v[]) > { > int i,s=0; > float av; > for(i=0;i<n;i++) > s+=v[i]; > > av=(float)s/n; > > return av; > } > > void main() > { > clrscr(); > > int no, a[20]; > cout<<" no = "; > cin>>no; > r_string(no,a); > p_string(no,a); > > cout<<"String avarage is : "<<avarage_string(no,a); > > getch(); > } > [/code] > > Strings value are read from the keyboard, and i need a getch and > clrscr > method. > And how can I export the ruby code into *.exe ? > > Can somebody translate this into ruby ? I need it fast... > > -- > Posted via http://www.ruby-forum.com/. > Translate this for me, right now. No, by yesterday. == A time when you pay someone to do it. Or ask much nicer. But if you are trying to say that you're going to learn Ruby by comparing that C++ code to some Ruby code that accomplishes the same thing, you are either fooling us OR fooling yourself. Ruby and C++ are different enough that a side-by-side comparison isn't going to teach you much of anything in this case. It would more likely just confuse you, friend.