China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-19 20:18
中国DOS联盟论坛 » 网络日志(Blog) » 523066680 Editing Area View 33,497 Replies 42
Original Poster Posted 2009-02-13 18:49 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline

@echo off &setlocal enabledelayedexpansion
set /p inp=" : "
call :funa na %inp%
call :funa nb %inp:* =%


set /a lpna=0,lpr=-1
:lpna
set /a lpna+=1,lpnb=0,lpr+=1,lp=lpr
:lpnb
set /a lpnb+=1,lp+=1
::::::::::::::::::::::::::
set /a cup%lp%+=na%lpna%*nb%lpnb%
set /a tlpa=lp,tlpb=tlpa+1
:cuplp
set /a cup%tlpb%+=cup%tlpa%/10,cup%tlpa%=cup%tlpa%%%10
if !cup%tlpb%! gtr 9 (
set /a tlpa+=1,tlpb=tlpa+1
goto :cuplp
) else (if !cup%tlpb%! equ 0 set /a tlpb-=1)

::::::::::::::::::::::::::
if %lpnb% lss %nb% (goto :lpnb)
if %lpna% lss %na% (goto :lpna)

for /l %%a in (%tlpb%,-1,1) do set /p=!cup%%a!<nul
echo,
echo,wscript.echo %inp: =*%>x.vbs
cscript //nologo x.vbs
pause>nul &exit


:funa
set %1=%2
set funaa=0
:funaa
set /a funaa+=1
set %1%funaa%=!%1:~-%funaa%,1!
if not "!%1:~%funaa%!"=="" (goto :funaa)
set /a %1=funaa


Version 2

@echo off &setlocal enabledelayedexpansion
set /p inp=" : "
call :naxnb %inp%
pause

:naxnb
set numa=%1
set numb=%2
set /a la=0,lpr=-1
:la
set /a la+=1,lb=0,lpr+=1,lp=lpr
:lb
set /a lb+=1,lp+=1,tlpa=lp,tlpb=lp+1
:::::::::::::::::::::::::
set /a cup%lp%+=!numa:~-%la%,1! * !numb:~-%lb%,1!
:cuplp
set /a cup%tlpb%+=cup%tlpa%/10,cup%tlpa%=cup%tlpa%%%10
if !cup%tlpb%! gtr 9 (
set /a tlpa+=1,tlpb=tlpa+1
goto :cuplp
) else (if !cup%tlpb%! equ 0 set /a tlpb-=1)
::::::::::::::::::::::::::
if not "!numb:~%lb%!"=="" (goto :lb)
if not "!numa:~%la%!"=="" (goto :la)
for /l %%a in (%tlpb%,-1,1) do set /p=!cup%%a!<nul

::::::::vbs验证一下:::::::::::
echo,
echo,wscript.echo %inp: =*%>x.vbs
cscript //nologo x.vbs
pause>nul &exit



[ Last edited by 523066680 on 2009-2-21 at 10:46 ]
Floor 2 Posted 2009-02-13 18:50 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
2016-09 Update link address:


Articles

Batch Rename's Bug
http://www.cn-dos.net/forum/viewthread.php?tid=45655

TalkAboutString
http://www.cn-dos.net/forum/viewthread.php?tid=45654

Improvement of Paragraph Redirection Method
http://www.cn-dos.net/forum/viewthread.php?tid=45409

2 times ping1 is not equal to 1 time ping2
http://www.cn-dos.net/forum/viewthread.php?tid=45410

%var% instead of statement execution
http://www.cn-dos.net/forum/viewthread.php?tid=45240

Snake Idea Analysis (23rd floor)
http://www.cn-dos.net/forum/viewthread.php?tid=43369

Establishing a Permanent Abnormal Drive Letter
http://www.cn-dos.net/forum/viewthread.php?tid=41796


Mathematics related:

Batch Processing to Calculate 24 Points
http://www.cn-dos.net/forum/viewthread.php?tid=45488

Square Root of Integers from 1 to 99
http://www.cn-dos.net/forum/viewthread.php?tid=43046

Applications:

Can the Process Name of a Batch Script be Changed? (The solution is found in the link on the 24th floor.)
http://www.cn-dos.net/forum/viewthread.php?tid=42169

How to Implement Standby and Open Screen Saver with Script?
http://www.cn-dos.net/forum/viewthread.php?tid=45522

Batch Script Packaging Tool
http://www.cn-dos.net/forum/viewthread.php?tid=44620

Shutdown After 1 Hour
http://www.cn-dos.net/forum/viewthread.php?tid=45242

Generate Test Scripts to be Written
http://www.cn-dos.net/forum/viewthread.php?tid=45250

List the Current Smallest and Largest bat Files
http://www.cn-dos.net/forum/viewthread.php?tid=41517

Batch Renaming in 001, 002, 003 Format
http://www.cn-dos.net/forum/viewthread.php?tid=41643


Entertainment, Special Effects:

Digital Matrix Appears Point by Point, Random
http://www.cn-dos.net/forum/viewthread.php?tid=45878

Batch Processing to Write Large Character Effect - New Year Greeting Card
http://www.cn-dos.net/forum/viewthread.php?tid=45411

Animation Special Effects: Drawing Circles, Bouncing Balls, Progress Bars, Rising and Falling, etc.
http://www.cn-dos.net/forum/viewthread.php?tid=42124

Pure Batch Processing Version of Snake
http://www.cn-dos.net/forum/viewthread.php?tid=43369

Gradually Larger Circle in the Middle
http://www.cn-dos.net/forum/viewthread.php?tid=44785

Spatial Random Walking Particles + Initial Version of Snake
http://www.cn-dos.net/forum/viewthread.php?tid=43059

【Visual Category】Advancing Road + Airplane and Cannon
http://www.cn-dos.net/forum/viewthread.php?tid=41333

【Visual Category】Square Frame Gradually Expanding from the Middle and Then Becoming Smaller + Changing Color
http://www.cn-dos.net/forum/viewthread.php?tid=40711

Clock - Italic + Milliseconds (Updated, Reduced CPU and Flicker)
http://www.cn-dos.net/forum/viewthread.php?tid=41833

After Diving for Several Days, Completed Self-Satisfied Digital Rain
http://www.cn-dos.net/forum/viewthread.php?tid=42113

【Considered Monthly Post】I Try to Minimize Flicker Batch Processing Large Clock
http://www.cn-dos.net/forum/viewthread.php?tid=41757

Running All the Way, Episode 1, Jump!
http://www.cn-dos.net/forum/viewthread.php?tid=41981

Made a Self-Satisfied Scrolling Subtitle
http://www.cn-dos.net/forum/viewthread.php?tid=39780


Replies:

【Challenge】Draw Square and Parabola with Batch Processing 14th floor 15th floor 18th floor
http://bbs.bathome.cn/thread-3537-2-1.html

Batch Processing Fun Mathematics of n-order Snake Matrix 28th floor
http://www.cn-dos.net/forum/viewthread.php?tid=42472

How to Generate a Pure Digital Password Dictionary 6th floor
http://www.cn-dos.net/forum/viewthread.php?tid=33139

Permutation and Combination 27th floor
http://www.cn-dos.net/forum/viewthread.php?tid=41243


Water Area:

Handmade Sudoku Matrix
http://www.cn-dos.net/forum/viewthread.php?tid=45817

Treat Discrimination with Discrimination
http://www.cn-dos.net/forum/viewthread.php?tid=45986

523066680 Quotes
http://www.cn-dos.net/forum/viewthread.php?tid=46304

Half Story
http://www.cn-dos.net/forum/viewthread.php?tid=45521

Lightspeed Contradiction
http://www.cn-dos.net/forum/viewthread.php?tid=44789

1=0.9999999……?
http://www.cn-dos.net/forum/viewthread.php?tid=43058


Articles

Batch Rename's Bug
http://www.cn-dos.net/forum/viewthread.php?tid=45655

TalkAboutString
http://www.cn-dos.net/forum/viewthread.php?tid=45654

Improvement of Paragraph Redirection Method
http://www.cn-dos.net/forum/viewthread.php?tid=45409

2 times ping1 is not equal to 1 time ping2
http://www.cn-dos.net/forum/viewthread.php?tid=45410

%var% instead of statement execution
http://www.cn-dos.net/forum/viewthread.php?tid=45240

Snake Idea Analysis (23rd floor)
http://www.cn-dos.net/forum/viewthread.php?tid=43369

Establishing a Permanent Abnormal Drive Letter
http://www.cn-dos.net/forum/viewthread.php?tid=41796


Mathematics related:

Batch Processing to Calculate 24 Points
http://www.cn-dos.net/forum/viewthread.php?tid=45488

Square Root of Integers from 1 to 99
http://www.cn-dos.net/forum/viewthread.php?tid=43046

Applications:

Can the Process Name of a Batch Script be Changed? (The solution is found in the link on the 24th floor.)
http://www.cn-dos.net/forum/viewthread.php?tid=42169

How to Implement Standby and Open Screen Saver with Script?
http://www.cn-dos.net/forum/viewthread.php?tid=45522

Batch Script Packaging Tool
http://www.cn-dos.net/forum/viewthread.php?tid=44620

Shutdown After 1 Hour
http://www.cn-dos.net/forum/viewthread.php?tid=45242

Generate Test Scripts to be Written
http://www.cn-dos.net/forum/viewthread.php?tid=45250

List the Current Smallest and Largest bat Files
http://www.cn-dos.net/forum/viewthread.php?tid=41517

Batch Renaming in 001, 002, 003 Format
http://www.cn-dos.net/forum/viewthread.php?tid=41643


Entertainment, Special Effects:

Digital Matrix Appears Point by Point, Random
http://www.cn-dos.net/forum/viewthread.php?tid=45878

Batch Processing to Write Large Character Effect - New Year Greeting Card
http://www.cn-dos.net/forum/viewthread.php?tid=45411

Animation Special Effects: Drawing Circles, Bouncing Balls, Progress Bars, Rising and Falling, etc.
http://www.cn-dos.net/forum/viewthread.php?tid=42124

Pure Batch Processing Version of Snake
http://www.cn-dos.net/forum/viewthread.php?tid=43369

Gradually Larger Circle in the Middle
http://www.cn-dos.net/forum/viewthread.php?tid=44785

Spatial Random Walking Particles + Initial Version of Snake
http://www.cn-dos.net/forum/viewthread.php?tid=43059

【Visual Category】Advancing Road + Airplane and Cannon
http://www.cn-dos.net/forum/viewthread.php?tid=41333

【Visual Category】Square Frame Gradually Expanding from the Middle and Then Becoming Smaller + Changing Color
http://www.cn-dos.net/forum/viewthread.php?tid=40711

Clock - Italic + Milliseconds (Updated, Reduced CPU and Flicker)
http://www.cn-dos.net/forum/viewthread.php?tid=41833

After Diving for Several Days, Completed Self-Satisfied Digital Rain
http://www.cn-dos.net/forum/viewthread.php?tid=42113

【Considered Monthly Post】I Try to Minimize Flicker Batch Processing Large Clock
http://www.cn-dos.net/forum/viewthread.php?tid=41757

Running All the Way, Episode 1, Jump!
http://www.cn-dos.net/forum/viewthread.php?tid=41981

Made a Self-Satisfied Scrolling Subtitle
http://www.cn-dos.net/forum/viewthread.php?tid=39780


Replies:

【Challenge】Draw Square and Parabola with Batch Processing 14th floor 15th floor 18th floor
http://bbs.bathome.cn/thread-3537-2-1.html

Batch Processing Fun Mathematics of n-order Snake Matrix 28th floor
http://www.cn-dos.net/forum/viewthread.php?tid=42472

How to Generate a Pure Digital Password Dictionary 6th floor
http://www.cn-dos.net/forum/viewthread.php?tid=33139

Permutation and Combination 27th floor
http://www.cn-dos.net/forum/viewthread.php?tid=41243


Water Area:

Handmade Sudoku Matrix
http://www.cn-dos.net/forum/viewthread.php?tid=45817

Treat Discrimination with Discrimination
http://www.cn-dos.net/forum/viewthread.php?tid=45986

523066680 Quotes
http://www.cn-dos.net/forum/viewthread.php?tid=46304

Half Story
http://www.cn-dos.net/forum/viewthread.php?tid=45521

Lightspeed Contradiction
http://www.cn-dos.net/forum/viewthread.php?tid=44789

1=0.9999999……?
http://www.cn-dos.net/forum/viewthread.php?tid=43058




Articles Batch Rename's Bug http://www.cn-dos.net/forum/viewthread.php?tid=45655 TalkAboutString http://www.cn-dos.net/forum/viewthread.php?tid=45654 Improvement of Paragraph Redirection Method http://www.cn-dos.net/forum/viewthread.php?tid=45409 2 times ping1 is not equal to 1 time ping2 http://www.cn-dos.net/forum/viewthread.php?tid=45410 %var% instead of statement execution http://www.cn-dos.net/forum/viewthread.php?tid=45240 Snake Idea Analysis (23rd floor) http://www.cn-dos.net/forum/viewthread.php?tid=43369 Establishing a Permanent Abnormal Drive Letter http://www.cn-dos.net/forum/viewthread.php?tid=41796 Mathematics related: Batch Processing to Calculate 24 Points http://www.cn-dos.net/forum/viewthread.php?tid=45488 Square Root of Integers from 1 to 99 http://www.cn-dos.net/forum/viewthread.php?tid=43046 Applications: Can the Process Name of a Batch Script be Changed? (The solution is found in the link on the 24th floor.) http://www.cn-dos.net/forum/viewthread.php?tid=42169 How to Implement Standby and Open Screen Saver with Script? http://www.cn-dos.net/forum/viewthread.php?tid=45522 Batch Script Packaging Tool http://www.cn-dos.net/forum/viewthread.php?tid=44620 Shutdown After 1 Hour http://www.cn-dos.net/forum/viewthread.php?tid=45242 Generate Test Scripts to be Written http://www.cn-dos.net/forum/viewthread.php?tid=45250 List the Current Smallest and Largest bat Files http://www.cn-dos.net/forum/viewthread.php?tid=41517 Batch Renaming in 001, 002, 003 Format http://www.cn-dos.net/forum/viewthread.php?tid=41643 Entertainment, Special Effects: Digital Matrix Appears Point by Point, Random http://www.cn-dos.net/forum/viewthread.php?tid=45878 Batch Processing to Write Large Character Effect - New Year Greeting Card http://www.cn-dos.net/forum/viewthread.php?tid=45411 Animation Special Effects: Drawing Circles, Bouncing Balls, Progress Bars, Rising and Falling, etc. http://www.cn-dos.net/forum/viewthread.php?tid=42124 Pure Batch Processing Version of Snake http://www.cn-dos.net/forum/viewthread.php?tid=43369 Gradually Larger Circle in the Middle http://www.cn-dos.net/forum/viewthread.php?tid=44785 Spatial Random Walking Particles + Initial Version of Snake http://www.cn-dos.net/forum/viewthread.php?tid=43059 【Visual Category】Advancing Road + Airplane and Cannon http://www.cn-dos.net/forum/viewthread.php?tid=41333 【Visual Category】Square Frame Gradually Expanding from the Middle and Then Becoming Smaller + Changing Color http://www.cn-dos.net/forum/viewthread.php?tid=40711 Clock - Italic + Milliseconds (Updated, Reduced CPU and Flicker) http://www.cn-dos.net/forum/viewthread.php?tid=41833 After Diving for Several Days, Completed Self-Satisfied Digital Rain http://www.cn-dos.net/forum/viewthread.php?tid=42113 【Considered Monthly Post】I Try to Minimize Flicker Batch Processing Large Clock http://www.cn-dos.net/forum/viewthread.php?tid=41757 Running All the Way, Episode 1, Jump! http://www.cn-dos.net/forum/viewthread.php?tid=41981 Made a Self-Satisfied Scrolling Subtitle http://www.cn-dos.net/forum/viewthread.php?tid=39780 Replies: 【Challenge】Draw Square and Parabola with Batch Processing 14th floor 15th floor 18th floor http://bbs.bathome.cn/thread-3537-2-1.html Batch Processing Fun Mathematics of n-order Snake Matrix 28th floor http://www.cn-dos.net/forum/viewthread.php?tid=42472 How to Generate a Pure Digital Password Dictionary 6th floor http://www.cn-dos.net/forum/viewthread.php?tid=33139 Permutation and Combination 27th floor http://www.cn-dos.net/forum/viewthread.php?tid=41243 Water Area: Handmade Sudoku Matrix http://www.cn-dos.net/forum/viewthread.php?tid=45817 Treat Discrimination with Discrimination http://www.cn-dos.net/forum/viewthread.php?tid=45986 523066680 Quotes http://www.cn-dos.net/forum/viewthread.php?tid=46304 Half Story http://www.cn-dos.net/forum/viewthread.php?tid=45521 Lightspeed Contradiction http://www.cn-dos.net/forum/viewthread.php?tid=44789 1=0.9999999……? http://www.cn-dos.net/forum/viewthread.php?tid=43058


[ Last edited by 523066680 on 2016-9-28 at 11:42 ]
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
netbenton +15 2009-10-12 07:39
zzz19760225 +1 2016-07-06 22:09
Floor 3 Posted 2009-02-17 18:15 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
My exist . 仅仅是exist.
Floor 4 Posted 2009-02-17 18:42 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
```
@echo off &setlocal enabledelayedexpansion
set /p inp=" : "
call :funa na %inp%
call :funa nb %inp:* =%


set /a lpna=0,lpr=-1
:lpna
set /a lpna+=1,lpnb=0,lpr+=1,lp=lpr
:lpnb
set /a lpnb+=1,lp+=1
::::::::::::::::::::::::::
set /a axb=na%lpna%*nb%lpnb%
set /a cup%lp%=axb+cup%lp%
if !cup%lp%! gtr 9 (set "do=") else (set do=::)

%do% set /a tlpa=lp,tlpb=tlpa+1
%do% :cuplp
%do% set /a cup%tlpa%=cup%tlpa%-10,cup%tlpb%+=1
%do% set /a tlpa+=1,tlpb=tlpa+1
%do% if !cup%tlpb%! gtr 9 (goto :cuplp)

::::::::::::::::::::::::::
if %lpnb% lss %nb% (goto :lpnb)
if %lpna% lss %na% (goto :lpna)


for /l %%a in (1,1,8) do echo !cup%%a!

set /a temp=1234*1234
echo %temp%
pause>nul &exit


:funa
set /a %1=%2,funaa=0
:funaa
set /a funaa+=1
set %1%funaa%=!%1:~-%funaa%,1!
if not "!%1:~%funaa%!"=="" (goto :funaa)
set /a %1=funaa
```
Floor 5 Posted 2009-02-20 18:49 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
@echo off &setlocal enabledelayedexpansion
title code by 523066680
set /p inp="Enter two multipliers, separated by space: "
call :naxnb %inp%
pause
:naxnb
set numa=%1
set numb=%2
set /a la=0,lb=0,lp=0

:la
set /a la+=1,lb+=1,lp+=1

set /a lb+=1,tlpa=lp,tlpb=lp+1
:::::::::::::::::::::::::
set /a cup%lp%+=!numa:~-%la%,1! + !numb:~-%lb%,1!
:cuplp
set /a cup%tlpb%+=cup%tlpa%/10,cup%tlpa%=cup%tlpa%%%10
if !cup%tlpb%! gtr 9 (
set /a tlpa+=1,tlpb=tlpa+1
goto :cuplp
) else (if !cup%tlpb%! equ 0 set /a tlpb-=1)

::::::::::::::::::::::::::

if not "!numb:~%lb%!"=="" (goto :la)
if not "!numa:~%la%!"=="" (goto :la)
for /l %%a in (%tlpb%,-1,1) do set /p=!cup%%a!<nul
::::::::vbs verification:::::::::::
echo,
echo,wscript.echo %inp: =+%>x.vbs
cscript //nologo x.vbs
pause>nul &exit

[ Last edited by 523066680 on 2009-2-21 at 11:29 ]
Floor 6 Posted 2009-03-07 06:27 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
@echo off&setlocal enabledelayedexpansion
set /a sa=63456,sb=61426
:a
echo, %sb:~1,1%
echo,%sa:~1,3%
echo, %sb:~3,1%
echo,
echo, %sb:~0,1%
echo,&echo,
set /p inp="(w a s d): "
echo,
if %inp% equ w (
set sb=%sb:~1%%sb:~1,1%
)
if %inp% equ s (
set sb=%sb:~3,1%%sb:~0,4%
)
if %inp% equ a (
set sa=%sa:~1%%sa:~1,1%
)
if %inp% equ d (
set sa=%sa:~3,1%%sa:~0,4%
)
goto :a
Floor 7 Posted 2009-06-03 05:24 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
```c
typedef struct
{
int fa,fb;
} fraction;


char axb;

fraction arr;
fraction outvar;
int whox;
int overa;

void arrangement(int a,int n);
void next(fraction a,int n);
void count(fraction a,int x,fraction b,int n);

main()
{
int i,ma;
for (i=0;i<4;i++) arr.fb=1;
while (1)
{
printf("______________________\nPress = Quit \n\n");
printf("Input 4 numbers,such as: 3 3 8 8 : ");
scanf("%d %d %d %d",&ma,&ma,&ma,&ma);
overa=0;
arrangement(ma,4);
if (overa==0) printf("\n Not result!\n\n");
}
getch();
}

void arrangement(int a,int n)
{
int temp;
int i,j,k;
if (n==0)
{
next(arr,4);
return;
}
for (i=0;i<n;i++)
{ k=0;
arr.fa=a;
for (j=0;j<n;j++) {if (i!=j) temp=a;}
arrangement(temp,n-1);
}
}


void next(fraction a,int n)
{
int i,j;
fraction temp;
if ((overa==0)&&(n==1)&&(a.fa==24*a.fb))
{printf("\n ");
if (whox==0)
{
if (whox==0)
{printf(" %c %d",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==1)
{printf(" %c %d",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==2)
{printf("(%d %c %d) %c (%d %c %d)",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
}
else
{
if (whox==0)
{printf("(%d %c %d) %c (%d %c %d)",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==1)
{printf("%d %c ",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}
else if (whox==2)
{printf("%d %c ",arr.fa,axb,arr.fa,axb,arr.fa,axb,arr.fa);}

}
printf(" = 24 \n\n");
overa=1;
return;
}
for (i=0;i<n-1;i++)
{
whox=i;
for (j=0;j<n;j++){temp.fa=a.fa;temp.fb=a.fb;}
for (j=i+1;j<n-1;j++){temp.fa=temp.fa;temp.fb=a.fb;}
for (j=0;j<4;j++)
{
count(a,j,a,n);
temp.fa=outvar.fa;
temp.fb=outvar.fb;
if (outvar.fb!=0) next(temp,n-1);
}
}
}

void count(fraction a,int x,fraction b,int n)
{

if (x==0)
{
axb='+';
outvar.fa=(a.fa*b.fb)+(b.fa*a.fb);
outvar.fb=a.fb*b.fb;
}
else if (x==1)
{
axb='-';
outvar.fa=(a.fa*b.fb)-(b.fa*a.fb);
outvar.fb=a.fb*b.fb;
}
else if (x==2)
{
axb='*';
outvar.fa=a.fa*b.fa;
outvar.fb=a.fb*b.fb;
}
else if (x==3)
{
axb='/';
outvar.fa=a.fa*b.fb;
outvar.fb=a.fb*b.fa;
}
}
```
Attachments
COUNT24B.rar (7.78 KiB, Credits to download 1 pts, Downloads: 1)
Floor 8 Posted 2009-07-07 23:33 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
```cpp
#include "Conio.h"
#include "graphics.h"
#include "stdlib.h"
#define closegr closegraph

void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}

int main(void)
{
int a,b,x,y,i,j;
randomize();
initgr(); /* BGI initialization */
x=y=200;
for (i=1;i<=15;i++)
{
a=rand()%600+1;b=rand()%400+20;

putpixel(x,y,4);
while (x!=a||y!=b)
{
if (x<a)
x++;
else if (x>a)
x--;
else
{
if (y<b)
y++;
else if (y>b)
y--;
}
for (j=0;j<=100;j++) delay(10);
putpixel(x,y,i);
}
}
rectangle(x-5,y-5,x+5,y+5);

getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
Floor 9 Posted 2009-07-07 23:57 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
```cpp
#include "Conio.h"
#include "graphics.h"
#include "stdlib.h"
#define closegr closegraph

void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}

int main(void)
{
int a, b, x, y, i, j, dtl = 50, dtn = 0;
int dot;
randomize();
initgr(); /* BGI initialization */
x = y = 200;
dot = dot = 200;

for (i = 1; i < dtl; i++) { dot = 0; dot = 0; }
for (i = 1; i <= 15; i++)
{
a = rand() % 600 + 1; b = rand() % 400 + 20;

putpixel(x, y, 4);
while (x != a || y != b)
{
if (x < a)
x++;
else if (x > a)
x--;
else
{
if (y < b)
y++;
else if (y > b)
y--;
}
for (j = 0; j <= 100; j++) delay(10);
putpixel(x, y, i);

if (dtn < (dtl - 1)) dtn++;
else dtn = 0;

if (dot != 0) putpixel(dot, dot, 0);
dot = x; dot = y;
}
}
rectangle(x - 5, y - 5, x + 5, y + 5);

getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
Floor 10 Posted 2009-07-13 00:07 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline

#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NSNK 5
#define LONG 60

void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}

int main(void)
{
int i,j;
struct {
int a,b,x,y,dtl,dtn,dot;
} snk;

initgr(); /* BGI initialization */

for (i=0;i<NSNK;i++) {
snk.a=snk.b=snk.x=snk.y=snk.dot=snk.dot=200;
snk.dtl=LONG;
snk.dtn=0;
for (j=1;j<LONG;j++) {snk.dot=snk.dot=0;}
}
randomize();
while (!kbhit())
{
for (i=0;i<150;i++) delay(10);
for (i=0;i<NSNK;i++){
putpixel(snk.x,snk.y,i+1);
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NSNK;i++){
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
if (snk.dtn<(snk.dtl-1)) snk.dtn++;
else snk.dtn=0;

if (snk.dot.dtn]!=0) putpixel(snk.dot.dtn],snk.dot.dtn],0);
snk.dot.dtn]=snk.x;
snk.dot.dtn]=snk.y;
}


}

getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}



NLine

#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NSNK 5

void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}

int main(void)
{
int i,j;
struct {
int a,b,x,y;
} snk;

initgr(); /* BGI initialization */

for (i=0;i<NSNK;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
randomize();
while (!kbhit())
{
for (i=0;i<150;i++) delay(10);
for (i=0;i<NSNK;i++){
putpixel(snk.x,snk.y,i+1);
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NSNK;i++){
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}


}

getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}




5RandDot

#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NDOT 5

void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}

void func(int x,int y,int c)
{
putpixel(x,y,c);
putpixel(x+1,y,c);
putpixel(x,y+1,c);
putpixel(x+1,y+1,c);
}

int main(void)
{
int i,j,whi=0;
struct {
int a,b,x,y,tx,ty;
} snk;

initgr(); /* BGI initialization */

for (i=0;i<NDOT;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
randomize();
while (!kbhit())
{
if (whi<4) whi++; else whi=0;
for (i=0;i<150;i++) delay(10);
for (i=0;i<NDOT;i++){
func(snk.tx,snk.ty,0);
func(snk.x,snk.y,i+1);
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NDOT;i++){
snk.tx=snk.x;
snk.ty=snk.y;
if (whi>i) continue;
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}


}

getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}





[ Last edited by 523066680 on 2009-7-13 at 22:18 ]
Floor 11 Posted 2009-07-13 22:31 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
```c
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NDOT 3

void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}

void delta(int xa,int ya,int xb,int yb,int xc,int yc,int c)
{
setcolor(c);
line(xa,ya,xb,yb);
line(xa,ya,xc,yc);
line(xb,yb,xc,yc);
}

int main(void)
{
int i,j,whi=0;
struct {
int a,b,x,y,tx,ty;
} snk;

initgr(); /* BGI initialization */

for (i=0;i<NDOT;i++) {
snk.a=snk.b=snk.x=snk.y=200;
}
randomize();
while (!kbhit())
{
if (whi<3) whi++; else whi=0;
for (i=0;i<200;i++) delay(10);

delta(snk.tx,snk.ty,snk.tx,snk.ty,snk.tx,snk.ty,0);
delta(snk.x,snk.y,snk.x,snk.y,snk.x,snk.y,2);

for (i=0;i<NDOT;i++){
if ((snk.x==snk.a)&&(snk.y==snk.b)){
snk.a=rand()%600+1;
snk.b=rand()%400+20;
}
}
for (i=0;i<NDOT;i++){
snk.tx=snk.x;
snk.ty=snk.y;
if (whi>i) continue;
if (snk.x>snk.a)
snk.x--;
else if (snk.x<snk.a)
snk.x++;
else
{
if (snk.y>snk.b)
snk.y--;
else if (snk.y<snk.b)
snk.y++;
}
}


}

getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
Floor 12 Posted 2009-07-13 23:07 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
```cpp
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph
#define NDOT 4


typedef struct
{
int a, b, x, y;
} DotInf;


void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}

void delta(DotInf dot, int c)
{
int i, j;
setcolor(c);
for (i = 0; i < NDOT; i++)
for (j = i + 1; j < NDOT; j++) line(dot.x, dot.y, dot.x, dot.y);
}

int main(void)
{
int i, j, whi = 0;
DotInf snk, everdot;

initgr(); /* BGI initialization */

for (i = 0; i < NDOT; i++) {
snk.a = snk.b = snk.x = snk.y = 200;
}
delta(snk, 2);
randomize();
while (!kbhit())
{
if (whi < 4) whi++; else whi = 0;
for (i = 0; i < 600; i++) delay(10);

delta(everdot, 0);
delta(snk, 2);

for (i = 0; i < NDOT; i++) {
if ((snk.x == snk.a) && (snk.y == snk.b)) {
snk.a = rand() % 600 + 1;
snk.b = rand() % 400 + 20;
}
}
for (i = 0; i < NDOT; i++) {
everdot.x = snk.x;
everdot.y = snk.y;
if (whi > i) continue;
if (snk.x > snk.a)
snk.x--;
else if (snk.x < snk.a)
snk.x++;
else
{
if (snk.y > snk.b)
snk.y--;
else if (snk.y < snk.b)
snk.y++;
}
}


}

getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}

```

[ Last edited by 523066680 on 2009-8-23 at 07:13 ]
Floor 13 Posted 2009-07-14 03:06 ·  中国 广东 揭阳 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
```cpp
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph

void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}
int main(void)
{
int i,j;
initgr(); /* BGI initialization */

randomize();
while (!kbhit())
{
for (j=200;j<=300;j++)
{
putpixel(rand()%400+1,j,4);
putpixel(rand()%400+1,j,0);
}
for (j=0;j<200;j++) delay(10);
}

getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```
Feels like a barrage~ Randomly made
```cpp
#include <Conio.h>
#include <graphics.h>
#include <stdlib.h>
#define closegr closegraph

void initgr(void) /* BGI initialization */
{
int gd = DETECT, gm = 0;
registerbgidriver(EGAVGA_driver);
initgraph(&gd, &gm, "");
}

void func(int x,int y,int c)
{ setcolor(c);
rectangle(x-4,y-4,x+4,y+4);
}
int main(void)
{
int i,j;
initgr(); /* BGI initialization */

randomize();

while (!kbhit())
{
for (i=1;i<=30;i++)
{
for (j=1;j<=30;j++) if (rand()%30>20) func(j*10,i*10,1);
for (j=1;j<=30;j++) if (rand()%30>10) func(j*5,i*5,0);
}
for (j=0;j<500;j++) delay(20);
}
getch();
closegr(); /* Restore TEXT screen mode */
return 0;
}
```

[ Last edited by 523066680 on 2009-7-14 at 03:26 ]
Floor 14 Posted 2009-08-02 10:06 ·  中国 广东 广州 天河区 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline


[ Last edited by 523066680 on 2009-8-2 at 10:09 ]
Floor 15 Posted 2009-08-18 09:39 ·  中国 广东 广州 天河区 电信
银牌会员
★★★★
SuperCleaner
Credits 2,362
Posts 1,133
Joined 2008-02-02 21:36
18-year member
UID 110072
Gender Male
Status Offline
It seems that the text - operation code that doesn't meet the requirements, I'll keep it for myself. The text to be processed is text.txt.

If it exceeds 80 bytes, it will be converted to one line. The character processing is okay, but the efficiency is not good.


@echo off
err>result.x 2>nul
set /a x=0
for /f "delims= eol=#" %%a in (text.txt) do (
set /a x+=1
set /a seta=0,setb=80
echo, %%a>x.x
call :func
)
start result.x
pause
exit

:func
echo,Sentence%x%
type x.x>temp.x
fsutil file setzerodata offset=0 length=%seta% temp.x >nul
fsutil file setzerodata offset=%setb% length=10000 temp.x >nul
(for /f "delims= eol=#" %%c in ('more temp.x') do (echo,%%c>temp.x))||goto :eof
for /f "tokens=3" %%a in ('dir temp.x /-c ^|find "个文件"') do (set num=%%a)
set /a seta=seta+num-2,setb=seta+80 &type temp.x>>result.x &goto :func
goto :eof


[ Last edited by 523066680 on 2009-8-18 at 09:41 ]
Forum Jump: