• Web sitemizin içeriğine ve tüm hizmetlerimize erişim sağlamak için Web sitemize kayıt olmalı ya da giriş yapmalısınız. Web sitemize üye olmak tamamen ücretsizdir.
  • Sohbetokey.com ile canlı okey oynamaya ne dersin? Hem sohbet et, hem mobil okey oyna!
  • Soru mu? Sorun mu? ''Bir Sorum Var?'' sistemimiz aktiftir. Paylaşın beraber çözüm üretelim.

metin şifreleme

Üyelik Tarihi
7 Ocak 2015
Konular
4,091
Mesajlar
4,274
MFC Puanı
40
Kod:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>

int main(int argc, char *argv[]) {
	int i,x;
	char a[10000],y;
	setlocale(LC_ALL,"turkish");
	tekrar:
	printf("metni giriniz\n");
	scanf("%s",&a);
	printf("şifre çözmek için '1' şifrelemek için'0'\n");
	scanf("%d",&x);
	if(x==0)
	 for(i=0; i<strlen(a);i++){
     if(a[i]>=65 && a[i]<=90)
	 { 
	 a[i]=a[i]+5;
     if(a[i] > 90)
	  a[i] = (a[i]%90)+64;
	 }
     else if(a[i]>=97 && a[i]<=122)
	 {
	 a[i]=a[i]+5;
	 if(a[i] > 122) 
	a[i] = (a[i]%122)+96;
     }
     else
   {
	printf("hatalı giriş\n");
     goto tekrar;
	 }
	 printf("%c",a[i]);
	
 }else if(x==1)
  for(i=0; i<strlen(a);i++){
     if(a[i]>=65 && a[i]<=90)
	 { 
	 a[i]=a[i]-5;
     if(a[i] < 65)
	  a[i] = (a[i]%65)+26;
	 }
     else if(a[i]>=97 && a[i]<=122)
	 {
	 a[i]=a[i]-5;
	 if(a[i]<97) 
	a[i] = (a[i]%97)+26;
     }
     else
     {
	printf("hatalı giriş\n");
     goto tekrar;
	 }
	 printf("%c",a[i]);
}

	return 0;
}
 
Üst