enkripsi simple julius caesar bahasa C
berikut merupakan source code enkripsi julius caesar bahasa c simple
#include<stdio.h>
#include<string.h>
int main(){
int bil1[]={1,2};
int b;
int a,z;
int c=0,x=0,angka1,angka2[10],angka3;
int l[6];
int f=0;
int t=0;
int temp[25],haha;
int e,coba;
int kele;
int jumlahAngka=100,jums,pil,jumstul,bening;
char array[100],apaja,tulisan[100];
char chiper[]={'=','d','e','f','g','h','i','j','k','l','m','n','o',
'p','q','r','s','t','u','v','w','x','y','z','a','b','c'};
char plain[]={'=','a','b','c','d','e','f','g','h','i','j','k','l',
'm','n','o','p','q','r','s','t','u','v','w','x','y','z'};
/// printf("%c",chiper[5]);
//char kata[]={'y','d','s','h','u'};
printf("masukan huruf");
scanf("%s",&tulisan);
fflush(stdin);
jumstul=strlen(tulisan);
for(jums=0;jums<=jumstul-1;jums++){
printf("masukan ualng huruf");
scanf("%c",&apaja);
fflush(stdin);
array[jums]=apaja;
}
for(a=0;a<=26;a++){
if(array[c]==plain[a]){
l[c]=a;
c++;
a=0;
}
}
for(z=0;z<=26;z++){
if(z==l[x]){
printf("%c",chiper[z]);
x++;
z=0;
}
}
return 0;
}
#include<stdio.h>
#include<string.h>
int main(){
int bil1[]={1,2};
int b;
int a,z;
int c=0,x=0,angka1,angka2[10],angka3;
int l[6];
int f=0;
int t=0;
int temp[25],haha;
int e,coba;
int kele;
int jumlahAngka=100,jums,pil,jumstul,bening;
char array[100],apaja,tulisan[100];
char chiper[]={'=','d','e','f','g','h','i','j','k','l','m','n','o',
'p','q','r','s','t','u','v','w','x','y','z','a','b','c'};
char plain[]={'=','a','b','c','d','e','f','g','h','i','j','k','l',
'm','n','o','p','q','r','s','t','u','v','w','x','y','z'};
/// printf("%c",chiper[5]);
//char kata[]={'y','d','s','h','u'};
printf("masukan huruf");
scanf("%s",&tulisan);
fflush(stdin);
jumstul=strlen(tulisan);
for(jums=0;jums<=jumstul-1;jums++){
printf("masukan ualng huruf");
scanf("%c",&apaja);
fflush(stdin);
array[jums]=apaja;
}
for(a=0;a<=26;a++){
if(array[c]==plain[a]){
l[c]=a;
c++;
a=0;
}
}
for(z=0;z<=26;z++){
if(z==l[x]){
printf("%c",chiper[z]);
x++;
z=0;
}
}
return 0;
}
thanks infonya gan, sangat membantu
BalasHapus