1-amaliy ish Almashtirishlar usuli yordamida axborotni kodlash Monoalfavitli almashtirishlar. Polealfavitli almashtirishlar


Download 0.97 Mb.
bet5/5
Sana27.10.2020
Hajmi0.97 Mb.
#137246
1   2   3   4   5
Bog'liq
1 amaliy ish

#include

#include

using namespace std;

int main()

{ string kalit,matn, s1="", s2="", alifbo="", tayyor="";

cout << "BU DASTURDA INGLIZ TILI ALIBOSIDAN FOYDALANILGAN !" << endl;

cout << "KATTA HARFLARDA MATN KIRITING !" << endl;

alifbo = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

cout<<"kalit so'zni kiriting:"; cin>>kalit;

cout<<"matnni kiriting : "; cin >> matn;

int k=0;

for( int i=0; i < matn.length(); i++)

{

s1=alifbo;

if( k == kalit.length() ) k=0;

s2=s1.substr(s1.find(kalit.at(k))) + s1.substr(0,s1.find(kalit.at(k)));

tayyor += s1.at(s2.find(matn.at(i)));

k++;

}

cout<

return 0;

}

Mustaqil bajarish uchun siz monoalfavitli almashtirishga dastur tuzing?
Download 0.97 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling