感应少年 经典漫画 第二本 喜欢的过来看看
#include <stdio.h>#include <stdlib.h>
#include <string.h>
#include <windows.h>
void tenToSixteen(unsigned long num, char *str) ;
unsigned long sixteenToTen(char *str) ;
int main(int avgc, char *argv[])
{
char linkBasic[150] = "http://111. ;
char linkEnd[20] = "8FF" ;
char link[200] = "" ;
unsigned long n, en = 6 ;
FILE *fp ;
if((fp = fopen("OutLink.html", "wt+")) == NULL)
{
printf("Creat File Error!") ;
return 0 ;
}
n = sixteenToTen(linkEnd) ;
for(int i = 1;i <= 199;i++)
{
strcpy(link, "") ;
strcpy(linkEnd, "") ;
tenToSixteen(n+(i >= ((6-en)*28.5+29) && i <= ((6-en)*28.5+38))*0x100, linkEnd) ;
sprintf(link, "<img src=\"%s%03d%d%05s.jpg\" />\n", linkBasic, i, en, linkEnd) ;
fputs(link, fp) ;
n += 2807 ;
if(i >= (6-en)*28.5+29) //
{
en-- ;
n += 0x100 ;
}
}
fclose(fp) ;
char ch[20] = "OutLink.html" ;
ShellExecute(NULL, "open", ch, NULL, NULL, SW_SHOW) ;
}
void tenToSixteen(unsigned long num, char *str)
{
char SixChar[17] = "0123456789ABCDEF" ;
int i = 0, j ;
char tempStr[20] = "" ;
do
{
tempStr[i++] = SixChar[num%16] ;
num = num/16 ;
}while(num) ;
for(j = 0;j < i;j++)
str[j] = tempStr[i-j-1] ;
}
unsigned long sixteenToTen(char *str)
{
int len ;
int i ;
unsigned long st = 1 ;
unsigned long num = 0 ;
len = strlen(str)-1 ;
for(i = len;i >= 0;i--)
{
if(str[i] > '9')
num += (str[i]-'A'+10)*st ;
else
num += (str[i]-'0')*st ;
st *= 16 ;
}
return num ;
}