C/C++の宿題を片付けます 87代目
at TECH
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
100:デフォルトの名無しさん 07/05/15 17:56:05 >>97 なんだ、ぼるじょあスレとマルチかYO! 101:気まぐれアナスイ 07/05/15 18:04:02 #include <stdio.h> int main(void>{ int i; char a[]={"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"}; int b[]={01,10,11,02,20,22,03,30,33,04,40,44,05,50,55,06,60,66,07,70,77,08,80,88,09,90,99"}; printf(); scanf(); while(){ } printf(); return0; } 102:気まぐれアナスイ 07/05/15 18:08:58 !(Φ_Φ+){こっちかな?} #include <stdio.h>|(/n) int main(void>{ int i;|(/n) char a[]={"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"};|(/n) int b[]={01,10,11,02,20,22,03,30,33,04,40,44,05,50,55,06,60,66,07,70,77,08,80,88,09,90,99"};|(/n) printf();|(/n) scanf();|(/n) while(){ }|(/n) printf();|(/n) return0; }|(/n) 103:デフォルトの名無しさん 07/05/15 18:17:32 こんなもんでしょ。 #include <stdio.h> #include <string.h> void encryptPrint(const char * str) { static char const src[] = "abcdefghijklmnopqrstuvwxyz"; static char const dest[] = { 1, 10, 11, 2, 20, 22, 3, 30, 33, 4, 40, 44, 5, 50, 55, 6, 60, 66, 7, 70, 77, 8, 80, 88, 9, 90}; int len = strlen(str); for (int ic = 0; ic < len; ++ic) { char * ptr = strchr(src, str[ic]); if (ptr != NULL) { printf("%02d", dest[ptr - src]); } else { putchar(str[ic]); } } } int main() { char buf[200]; while (fgets(buf, sizeof(buf), stdin) != NULL) { encryptPrint(buf); } return 0; }
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
4181日前に更新/299 KB
担当:undef