C言語なら俺に聞け(入門篇) Part 23 at TECH
[2ch|▼Menu]
805:デフォルトの名無しさん
08/01/14 11:58:06
// >>801
#include <stdio.h>
#include <string.h>

void func(int width, const char * str)
{
int len = strlen(str);
for (int ic = 0; ic <= len; ++ic) {
printf("\r%*.*s", width, ic, str);
fflush(stdout);
sleep(1);
}
for (int ic = 0; ic < width; ++ic) {
printf("\r%*s%*s", width - 1 - ic,
ic < width - len ? str : str + ic + 1 - width + len,
ic + 1, "");
fflush(stdout);
sleep(1);
}
}

int main()
{
func(20, "abcde");
return 0;
}


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5501日前に更新/237 KB
担当:undef