codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <string> using namespace std; void happy(); void birthday(int iterator[], string party); int main( int argc, const char* argv[] ){ happy(); return 0; } void happy(){ string party = "Happy Birthday!"; int partyLength = party.length(); int iterator[2] = {partyLength,partyLength-1}; for(int condition=0; condition<iterator[0]; birthday(iterator, party)){ iterator[0]--; } } void birthday(int iterator[], string party){ int position = iterator[1]-iterator[0]; cout<<party.substr(position,1); }
Private
[
?
]
Run code
Submit