当前位置: 代码迷 >> C语言 >> C语言能不能直接嵌入到网页代码中去?
  详细解决方案

C语言能不能直接嵌入到网页代码中去?

热度:348   发布时间:2008-06-01 21:24:38.0
C语言能不能直接嵌入到网页代码中去?
C语言能不能直接嵌入到网页代码中去?
搜索更多相关的解决方案: C语言  网页  代码  

----------------解决方案--------------------------------------------------------
ASP/PHP本身的语法很像C

[color=white]
----------------解决方案--------------------------------------------------------
ActiveX控件
----------------解决方案--------------------------------------------------------
燕子你开始做网页了吗?
----------------解决方案--------------------------------------------------------
像 C 的很多...  C也像很多
----------------解决方案--------------------------------------------------------
[bo][un]Loli[/un] 在 2008-6-1 21:29 的发言:[/bo]

ASP/PHP本身的语法很像C

http://yzfy.igotfree.com/pp.php

ASP还像C?!!
ASP是BASIC语法系列的
----------------解决方案--------------------------------------------------------
谁能帮我把这两个东西结合起来?拜托拜托,谢谢谢谢!

#include<stdio.h>
void weixian(int qi[15][15]);
void heshi(int qi[15][15]);
int max=0,xx,yy;
void main()
{
    int qi[15][15]={0},x,y,i;
    for(i=0;i<123;i++)
    {
        printf("输入x和y:");
        scanf("%d %d",&x,&y);
        qi[x][y]=1;
        weixian(qi);
        if(max>=5)
        {
            printf("玩家胜!\n");
            break;
        }
        if(max<3)
        {
            heshi(qi);
            if(max>=4)
            {
                qi[xx][yy]=2;
                printf("输出x和y:%d %d\n",xx,yy);
                printf("电脑胜!\n");
                break;
            }
        }
        qi[xx][yy]=2;
        printf("输出x和y:%d %d\n",xx,yy);
        max=0;
    }
    if(max<=3) printf("平棋!\n");
}

void weixian(int qi[15][15])
{
    int aa[15][15][4],a,b=0,c,x,y,i;
    for(x=0;x<15;x++)
        for(y=0;y<15;y++)
            if(qi[x][y]==0)
            {
                a=y;a++;
                for(;a>=0&&a<=14&&qi[x][a]==1&&a<=y+5;a++)
                    b++;a=y;a--;
                for(;a>=0&&a<=14&&qi[x][a]==1&&a>=y-5;a--)
                    b++;
                aa[x][y][0]=b;
                b=0;a=x;a++;
                for(;a>=0&&a<=14&&qi[a][y]==1&&a<=x+5;a++)
                    b++;a=x;a--;
                for(;a>=0&&a<=14&&qi[a][y]==1&&a>=x-5;a--)
                    b++;
                aa[x][y][1]=b;
                b=0;a=x,c=y;a++,c++;
                for(;a>=0&&a<=14&&c>=0&&c<=14&&qi[a][c]==1&&a<=x+5;a++,c++)
                    b++;a=x,c=y;a--,c--;
                for(;a>=0&&a<=14&&c>=0&&c<=14&&qi[a][c]==1&&a>=x-5;a--,c--)
                    b++;
                aa[x][y][2]=b;
                b=0;a=x,c=y;a++,c--;
                for(;a>=0&&a<=14&&c>=0&&c<=14&&qi[a][c]==1&&a<=x+5;a++,c--)
                    b++;a=x,c=y;a--,c++;
                for(;a>=0&&a<=14&&c>=0&&c<=14&&qi[a][c]==1&&a>=x-5;a--,c++)
                    b++;
                aa[x][y][3]=b;
                b=0;
                for(i=0;i<4;i++)
                    if(aa[x][y][i]>=max)
                    {
                        max=aa[x][y][i];
                        xx=x;
                        yy=y;
                    }
            }
}

void heshi(int qi[15][15])
{
    int aa[15][15][4],a,b=0,c,x,y,i;
    for(x=0;x<15;x++)
        for(y=0;y<15;y++)
            if(qi[x][y]==0)
            {
                a=y;a++;
                for(;a>=0&&a<=14&&qi[x][a]==2&&a<=y+5;a++)
                    b++;a=y;a--;
                for(;a>=0&&a<=14&&qi[x][a]==2&&a>=y-5;a--)
                    b++;
                aa[x][y][0]=b;
                b=0;a=x;a++;
                for(;a>=0&&a<=14&&qi[a][y]==2&&a<=x+5;a++)
                    b++;a=x;a--;
                for(;a>=0&&a<=14&&qi[a][y]==2&&a>=x-5;a--)
                    b++;
                aa[x][y][1]=b;
                b=0;a=x,c=y;a++,c++;
                for(;a>=0&&a<=14&&c>=0&&c<=14&&qi[a][c]==2&&a<=x+5;a++,c++)
                    b++;a=x,c=y;a--,c--;
                for(;a>=0&&a<=14&&c>=0&&c<=14&&qi[a][c]==2&&a>=x-5;a--,c--)
                    b++;
                aa[x][y][2]=b;
                b=0;a=x,c=y;a++,c--;
                for(;a>=0&&a<=14&&c>=0&&c<=14&&qi[a][c]==2&&a<=x+5;a++,c--)
                    b++;a=x,c=y;a--,c++;
                for(;a>=0&&a<=14&&c>=0&&c<=14&&qi[a][c]==2&&a>=x-5;a--,c++)
                    b++;
                aa[x][y][3]=b;
                b=0;
                for(i=0;i<4;i++)
                    if(aa[x][y][i]>=max)
                    {
                        max=aa[x][y][i];
                        xx=x;
                        yy=y;
                    }
            }
}




------------------------------------------------------------------------------------


<html>
<head>
<title>五子棋</title>
<style type="text/css">
td{width:25;
height:25;
color:blue;}
</style>
<script language="JavaScript">
function setWhite()
{
  var objEle = document.all.tags("td");
  var i=0;
  var x=document.myform1.mytext1.value;
  var y=document.myform1.mytext2.value;
  i=(x-1)*15+(y-1);
  objEle(i).style.background= "black";
}
</script>
</head>
<body>
<center>
<h2>五子棋</h2>
<hr>
<form name="myform1">
横行:<input type="text" name="mytext1" width="80">&nbsp;&nbsp;
竖列:<input type="text" name="mytext2" width="80">&nbsp;&nbsp;
<input type="button" onClick="setWhite()" value="提交">
</form>
<table width="450" height="450" border="1">
  <tr>
    <td>1</td>
    <td>2</td>
    <td>3</td>
    <td>4</td>
    <td>5</td>
    <td>6</td>
    <td>7</td>
    <td>8</td>
    <td>9</td>
    <td>10</td>
    <td>11</td>
    <td>12</td>
    <td>13</td>
    <td>14</td>
    <td>15</td>
  </tr>
  <tr>
    <td>2</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>3</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>4</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>5</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>6</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>7</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>8</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>9</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>10</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>11</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>12</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>13</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>14</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>15</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
</center>
</body>
</html>
----------------解决方案--------------------------------------------------------
[bo][un]cdmalcl[/un] 在 2008-6-1 22:20 的发言:[/bo]


ASP还像C?!!
ASP是BASIC语法系列的

哦哦。。。其实ASP是我猜的

[color=white]
----------------解决方案--------------------------------------------------------
最典型的解决方案是CGI
----------------解决方案--------------------------------------------------------
[bo][un]cdmalcl[/un] 在 2008-6-1 22:20 的发言:[/bo]


ASP还像C?!!
ASP是BASIC语法系列的


我认为ASP中的VBScript像BASIC,JavaScript像C
----------------解决方案--------------------------------------------------------
  相关解决方案