C/C++の宿題を片付けます 115代目at TECH
C/C++の宿題を片付けます 115代目 - 暇つぶし2ch322:回答者修行中
08/08/22 11:50:25
質問者もういっちゃいましたね
#include <string.h>
#include <stdio.h>
int main()
{
int i, x, y, width=5, height=5, left=-1, top=-1;
char *p;
char field[5][5]={
{'#', '#', '#', '#', '#'},
{'#', '#', '#', '#', '#'},
{'#', '#', '#', '*', '*'},
{'#', '#', '#', '*', '*'},
{'#', '#', '#', '*', '*'},
};

p=strchr((char *)field,'*');
i = ((int)p - (int)field)/sizeof(char);
y=i/5;
x=i-y*5;
printf("x=%d y=%d",x,y);
return 0;
}
これまともに動いてる?


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