[dovelet]-crypt

2014. 1. 20. 19:18 from Programming

// 공백+대문자 기능 없음


#include <stdio.h>

#include <string.h>


void findplace(char encrypt[], char plane[], int place[], int len)

{

int i, j;

for(i=0; i<len; i++)

{

for(j=0; j<53; j++)

{

if(encrypt[i] == plane[j])

{

place[i] = j;

}

}

}

}


int main(void)

{

int k;

char key[27];

char encrypt[80];

char plane[53] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int place[80];

int len;


scanf("%s", key);

scanf("%s", encrypt);


len = strlen(encrypt);

findplace(encrypt, plane, place, len);

for(k=0; k<len; k++)

{

printf("%c", key[place[k]]);

}


return 0;

}

'Programming' 카테고리의 다른 글

간단한 정렬 알고리즘 정리  (0) 2014.02.03
타이머 함수  (0) 2014.02.01
os 판별 코드  (0) 2013.10.11
Binary Search  (0) 2013.07.18
좋은 사이트..  (0) 2013.07.13
Posted by xer0s :