>>500
下のプログラムを大枠として作っていただけないですか?
最後の方の三行がわかりません。
#include<stdio.h>
#define N 52 /* トランプの枚数 */
#define M (N/2) /* その半分の数 */
int main( void )
{
int k;
int cards[ N ]; /* トランプ */
int temp[ N ]; /* 一時的にトランプの札を移動 */
int count = 0; /* 切った回数 */
/* トランプをセット */
for( k=0; k<N; k++ )
cards[ k ] = k+1;
while( 1 ) /* 無限ループ */
{
count++; /* 回数を一回増分 */
temp ← cardsを2つに分けてぱらぱらと切ったものをひとつにしたもの
temp が元に戻っていたら終了(breakする)
cards ← temp
}
printf( "%d 回目で元に戻る", count );
return 0;
}