Skip to content

Instantly share code, notes, and snippets.

@wirajayaabadi
Created May 30, 2018 09:11
Show Gist options
  • Select an option

  • Save wirajayaabadi/9268d30d7cb0fe114603920dd313a7d3 to your computer and use it in GitHub Desktop.

Select an option

Save wirajayaabadi/9268d30d7cb0fe114603920dd313a7d3 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <conio.h>
#include <String.h>
using namespace std;
void enkripsi(char kalimat[100]){
int tes,i=0;
while(kalimat[i]!=0){
if(kalimat[i]==' '){
tes=0;
}else{
tes=(int(kalimat[i])+3)%255;
}
cout<<char(tes);
i++;
}
}
int main(){
char kalimat[100];
cout<<"Silahkan ketik kalimat : ";
cin.getline(kalimat,100);
cout<<"Hasil : ";
enkripsi(kalimat);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment