검색결과 리스트
글
geek_stuff/today
2006. 5. 31. 09:20
Linear Shifted Array Generator
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;
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' 카테고리의 다른 글
[이벤트] 티스토리(Tistory.com) 초대장을 드려용~♡ (17) | 2006.08.14 |
---|---|
티스토리 초대권 2장 쏩니다! (12) | 2006.07.14 |
티스토리 추천블로그? (1) | 2006.07.13 |
맥북을 지를까.. (3) | 2006.06.21 |
HSBC의 OTP (One time password) device. (3) | 2006.06.01 |
Tistory 초대권 응모관련... (17) | 2006.05.27 |
Tistory.com Beta에서의 첫 글 (3) | 2006.05.26 |
1kko.com 블로그의 변천사 (0) | 2006.05.21 |
자료구조 과제 #3 (0) | 2006.05.10 |
자료구조 과제 #2 (0) | 2006.05.10 |
RECENT COMMENT