I am C++ programmer and in C++ I used some thing that I want
corresponding those things in Ruby.
please help me.
In C++ , I can write thess program but in Ruby I can’t:
1 –
int i,x;
int sum=0;
for( x=0 ; x <= 50 ; x++ ) {
cin >> i;
sum = sum + ( x + i ) ;
}
cout << sum;
2 –
int a,b,c,d;
while( 1 ) {
cin >> a >> b >> c >>d ;
if( a < 0 || b < 0 )
break;
cout << a << " " << b << " " << c << " " << d << endl;
}
thanks.
Why not?
1.
2.