Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

hellloooaaaa

Name: Anonymous 2011-10-10 15:12

#include<iostream>
using namespace std;



int main( )
 {
   
 int x, sum, counter, sonuc;
 sum = 0;
 counter = 0;
 

 
 cout<<"ortalamasini almak istediginiz 5 numara girin"<<endl;
 cout<<"enter a number"<<endl;
 cin>>x;
 sum = sum + x;
 counter = counter + 1;
 
 
 cout<<"enter another number"<<endl;
 cin>>x;
  sum = sum + x;
 counter = counter + 1;

 cout<<"enter another number"<<endl;
 cin>>x;
  sum = sum + x;
 counter = counter + 1;
  cout<<"enter another number"<<endl;
 cin>>x;
  sum = sum + x;
 counter = counter + 1;
  cout<<"enter another number"<<endl;
 cin>>x;
  sum = sum + x;
 
 counter = counter + 1;
 sonuc = sum/counter;
 
 
 cout<<"sonuc = ";
 cout<<sonuc<<endl;
 
 system("PAUSE");
 
   return 0;
}





teach me how to loop this.yes,i'm a complete retard.

Name: Anonymous 2011-10-10 23:17

>>4
The more expert way to do it is with call/cc:



(let ((i 0)
      (back (call-with-current-continuation (lambda (x) x))))
  (display "This gets executed 5 times, expertly.")
  (when (< i 5)
    (set! i (+ 1 i))
    (back back)))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List