블로그 이미지
일상, 컴퓨터, 웹, 음악, 아트... 온갖 재밌고 신기한것들을 섞어놓은 퓨전 블로그

카테고리

분류 전체보기 (429)
complains (16)
personal (160)
geek_stuff (143)
music (0)
fun & cool (68)
photos & drawings (22)
work (0)
trackback_plays (14)

Linear Shifted Array Generator by !kKo

output_file<<((end-start)/shift)+1<<endl; // number of entries...

int j=0;
for (int i=start; i<=end; i=i+shift) // making array
{
  array[j++]=i;
}
 
//  Uncomment the following line to display the whole array.
// for (i=0;i<(end-start)/shift;i++){cout<<array[i]<<" ";} cout<<endl;
 
for (i=shift;i<=(end-start)/shift;i++) // writing to file
{
  output_file<<array[i]<<" ";
}
for (i=0;i<shift;i++) // writing to file
{
  output_file<<array[i];
  if(i<shift-1) output_file<<" ";
}
output_file<<endl;

Download Full Source Code

'geek_stuff > today' 카테고리의 다른 글

맥북을 지를까..  (3) 2006/06/21
HSBC의 OTP (One time password) device.  (3) 2006/06/01
Linear Shifted Array Generator  (0) 2006/05/31
Tistory 초대권 응모관련...  (17) 2006/05/27
Tistory.com Beta에서의 첫 글  (3) 2006/05/26
1kko.com 블로그의 변천사  (0) 2006/05/21
Posted by !kKo

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

Total9,414
Today15
Yesterday99