Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream> // dane https://pastebin.com/Xbm2ctpu
- #include <cmath>
- #include <cstdlib>
- #include <fstream>
- using namespace std;
- int main() {
- string alfabet = "ABCEDFGHIJKLMNOPQRSTUVWXYZ";
- int il = alfabet.length(), lol[2999];
- string wyraz, szyfr;
- int dl;
- int klucz = 107%il, i;
- ifstream dane1("dane_6_1.txt");
- ifstream dane2("dane_6_2.txt");
- ofstream wynik1("wynik_6_1.txt");
- ofstream wynik2("wynik_6_2.txt");
- while (!dane1.eof()) {
- dane1>>wyraz; // ZADANIE 1
- dl = wyraz.length();
- cout<<"Wyraz jawny: "<<wyraz<<endl<<"Wyraz zaszyfrowany: ";
- for(i=0;i<dl;i++) {
- cout<<char(wyraz[i]+klucz);
- wynik1<<char(wyraz[i]+klucz);
- }
- wynik1<<endl;
- cout<<endl<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment