Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- class cezar
- {
- int klucz;
- string dane;
- string szyfr;
- public:
- cezar(string,int);
- void szyfruj();
- string zaszyfrowany();
- };
- cezar::cezar(string dane1, int klucz1)
- {
- dane=dane1;
- klucz=klucz1;
- }
- void cezar::szyfruj(){
- for(int i=0;i<dane.length();i++){
- szyfr+=dane[i]+klucz;
- }
- }
- string cezar::zaszyfrowany(){
- return szyfr;
- }
- int main(int argc, char** argv) {
- cezar wyraz("xyz",2);
- wyraz.szyfruj();
- cout<<wyraz.zaszyfrowany();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement