| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3156 人关注过本帖
标题:C语言能不能直接嵌入到网页代码中去?
只看楼主 加入收藏
过傻过天真
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2008-5-4
收藏
 问题点数:0 回复次数:15 
C语言能不能直接嵌入到网页代码中去?
C语言能不能直接嵌入到网页代码中去?
搜索更多相关主题的帖子: C语言 网页 代码 
2008-06-01 21:24
Loli
Rank: 1
来 自:飞燕算法群46520219
等 级:新手上路
帖 子:348
专家分:0
注 册:2008-5-27
收藏
得分:0 
ASP/PHP本身的语法很像C

" border="0" />[color=white]
2008-06-01 21:29
cdmalcl
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:24
帖 子:4091
专家分:524
注 册:2005-9-23
收藏
得分:0 
ActiveX控件
2008-06-01 21:57
sunkaidong
Rank: 4
来 自:南京师范大学
等 级:贵宾
威 望:12
帖 子:4496
专家分:141
注 册:2006-12-28
收藏
得分:0 
燕子你开始做网页了吗?

学习需要安静。。海盗要重新来过。。
2008-06-01 21:59
yd4433
Rank: 1
等 级:新手上路
帖 子:404
专家分:0
注 册:2008-3-9
收藏
得分:0 
像 C 的很多...  C也像很多

------...-.-..-...-----........-------.......----.....------....||- - !
2008-06-01 22:13
cdmalcl
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:24
帖 子:4091
专家分:524
注 册:2005-9-23
收藏
得分:0 
[bo][un]Loli[/un] 在 2008-6-1 21:29 的发言:[/bo]

ASP/PHP本身的语法很像C

http://yzfy.

ASP还像C?!!
ASP是BASIC语法系列的
2008-06-01 22:20
过傻过天真
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2008-5-4
收藏
得分:0 
谁能帮我把这两个东西结合起来?拜托拜托,谢谢谢谢!

#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>
2008-06-01 22:28
Loli
Rank: 1
来 自:飞燕算法群46520219
等 级:新手上路
帖 子:348
专家分:0
注 册:2008-5-27
收藏
得分:0 
[bo][un]cdmalcl[/un] 在 2008-6-1 22:20 的发言:[/bo]


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

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

[color=white]
2008-06-01 22:39
forever74
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:CC
等 级:版主
威 望:58
帖 子:1692
专家分:4282
注 册:2007-12-27
收藏
得分:0 
最典型的解决方案是CGI
2008-06-01 22:48
过傻过天真
Rank: 1
等 级:新手上路
帖 子:54
专家分:0
注 册:2008-5-4
收藏
得分:0 
[bo][un]cdmalcl[/un] 在 2008-6-1 22:20 的发言:[/bo]


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


我认为ASP中的VBScript像BASIC,JavaScript像C
2008-06-01 22:52
快速回复:C语言能不能直接嵌入到网页代码中去?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.032472 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved