C/C++の宿題を片付けます 103代目
at TECH
55:デフォルトの名無しさん
08/01/15 16:56:37
//>>52
#include <stdio.h>
#include <ctype.h>
#include <string.h>
void crypt(char * foo)
{
static char const inputLetters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static char const outputLetters[] = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm";
for (int ic = 0; foo[ic] != '\0'; ++ic) {
int ch = foo[ic];
char * pos = strchr(inputLetters, ch);
if (pos != NULL) {
foo[ic] = outputLetters[pos - inputLetters];
}
}
}
int main()
{
char buf[81];
for (int ic = 0; ic < 10 && fgets(buf, sizeof(buf), stdin) != NULL; ++ic) {
crypt(buf);
fputs(buf, stdout);
}
return 0;
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4959日前に更新/357 KB
担当:undef