Facebook
From po, 3 Years ago, written in C.
Embed
Download Paste or View Raw
Hits: 53
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5.  
  6. int main(void)
  7.   {
  8.    int znak,przesuniecie;
  9.    printf("O ile chcesz przesunac alfabet: "); // nawet ujemne ujdzie do odszyfrowania
  10.    scanf("%d",&przesuniecie);
  11.  
  12.    przesuniecie%=26;
  13.  
  14.    if(przesuniecie<0) przesuniecie+=26;
  15.  
  16.    printf("Wiadomosc do zakodowania:");
  17.         while((znak=getchar())!=EOF){
  18.                 putchar('A'+(znak-'A'+przesuniecie)%26);
  19.                 }
  20.    return 0;
  21.   }
  22.  
  23.  
  24.  
  25.