# Mamajonov Ahrorbek

 Sana 14.12.2019 Hajmi 90,04 Kb. #30144
Bog'liq
2 5242251375701656620
Geografiya.5-sinflar-uchun, 10 guruh qaydnoma, 2 5242251375701656620, Lecture 10, Amaliy tarjima kunduzgi (1), Word, Gap bo'laklari test, strategiya, Abdurahmon
 Guruh 653-18 Bajardi Mamajonov Ahrorbek Qabul qildi Baho

2-Amaliy mashg’ulot

Vazifa har bir talaba o’z ismini y=k*x+b funksiya korinishida shifirlash va deshifirlashni dasturini tuzish.

Masalaning yechilishi .

#include

using namespace std;

int main()

{ int k,b,b1;

char matn1[1000];

cout<< " Matinni kiriting "<

cin>>matn1;

cout<<" k "<<" b"<

cin>>k>>b1;

char f[55]; int k1=0;

for (int i=97; i<123; i++){

f[k1]=int(i);

k1++;

} int y[1000];

for (int i=0; i

for (int j=0; j

if (matn1[i]==f[j]){

y[i]=(k*j+b1)%26;

} } } for(int i=0; i

cout<

} cout<

cout<<" Defishirlash jarayoni matinni kiriting "<

cin>>matn2; int r1, r2, r, t1, t2, t, q, b2,a,n;

cout<<" k b ni kirit: ";cin>>b>>b2;

n=26; r1 = n; r2 = b; t1 = 0; t2 = 1;

while (r2 > 0) { q = r1 / r2; r = r1 - q * r2;

r1 = r2; r2 = r; t = t1 - t2 * q;

t1 = t2; t2 = t;

} if (r1 == 1) { if (t1 >= 0) {

a = t1;

} else { a = n + t1;

} } else {

cout<<"Defishirlash mumkin emas"; goto f;

} int y1[1000];

for (int i=0; i

for (int j=0; j

if (matn2[i]==f[j]){

y1[i]=((j-b2)*a)%26;

} } }

for (int i=0; i

cout<

} f: return 0;}