fork download
  1. #include <iostream>
  2. using namespace std;
  3. int func(int s);
  4. int main() {
  5.  
  6. cout<<func(1)<<" "<<func(2)<<" " <<func(3)<<" "<<func(4)<<" "<<func(5)<<endl;
  7. return 0;
  8. }
  9. int func(int n)
  10. {
  11. int y=0;
  12. unsigned int i=10,j=10,k=10,l=10,m=10;
  13. switch(n)
  14. {
  15.  
  16. case 5:
  17. for(i=0;i<2;i++)
  18. case 4:
  19. for( j=0;j<2;j++)
  20. case 3:
  21. for( k=0;k<2;k++)
  22. case 2:
  23. for( l=0;l<2;l++)
  24. case 1:
  25. for( m=0;m<2;m++)
  26. y++;
  27.  
  28.  
  29. }
  30. return y;
  31. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
2 4 8 16  32