#include <cstdlib> #include <iostream> using namespace std; class Balik{ friend istream& operator>>(istream&, Balik&); friend ostream& operator<<(ostream&, Balik&); public: void balik_kata(); void balik(char *s); private: char kata[50]; }; void Balik::balik_kata(){ cout<<"Masukkan Kata Yang Akan Dibalik : "; cin>>kata; strrev(kata); cout<<"Kata Setelah Dibalik : "<<kata<<endl; } void Balik::balik(char *s){ if (*s != '\0'){ balik(&s[1]); cout<<s[0]; } } int main(){ Balik X; X.balik_kata(); system("PAUSE"); return EXIT_SUCCESS; }