首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看全站
import random

'''
实现一个猜数字小游戏,随机生成一个0~100以内的数据,由玩家来猜
每次猜完之后计算机告诉玩家是猜大了还是猜小了
共5次机会,5次猜不出来宣布游戏失败。

'''


class GuessNum:

......................
阅读全部 | SunCZ 贴于 2020年11月9日 18:24     hide bbsi
def math(x):
    y = 3*x + 5
    return y
阅读全部 | SunCZ 贴于 2020年11月9日 18:17     hide bbsi
Option Explicit

Public b
Public index
Public TCount As Integer''时钟刷新次数

'抽签30个,点击抽签显示数字,不重复(抽一个少一个)
Private Sub Form_Load()
  Timer1.Enabled = False
  index = 1
   Randomize
  ReDim b(1 To 1) As Integer
......................
阅读全部 | ysz123 贴于 2020年10月26日 10:48     hide bbsi
string dbname = Server.MapPath("App_Data/basketball.mdb");

        OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=" + dbname);
        conn.Open();
        OleDbDataAdapter da = new OleDbDataAdapter("select qian from t_arranges where quautity<2", conn);//quautity字段表示被抽次数
        DataSet ds = new DataSet();
        da.Fill(ds, "t_table");
        DataRow[] rows = ds.Tables[0].Select();
        int counts = rows.Length;
        if (counts > 0)  
        else
        {
......................
阅读全部 | ysz123 贴于 2020年10月26日 10:42     hide bbsi
string dbname = Server.MapPath("App_Data/basketball.mdb");

        OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=" + dbname);
        conn.Open();
        OleDbDataAdapter da = new OleDbDataAdapter("select qian from t_arranges where quautity<2", conn);//quautity字段表示被抽次数
        DataSet ds = new DataSet();
        da.Fill(ds, "t_table");
阅读全部 | ysz123 贴于 2020年10月26日 10:42     hide bbsi
#include<stdio.h>
int main()
{
int a,b,n,i;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d %d",&a,&b);
printf("%d\n",a+b);
}return 0;
}
阅读全部 | 小神女 贴于 2020年10月24日 16:41     hide bbsi
#include<stdio.h>
int main()
{
int i,n,a,b;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d %d",&a,&b);
if(a>b)
{
printf("%d\n",a);
}
......................
阅读全部 | 小神女 贴于 2020年10月24日 16:40     hide bbsi
#include<stdio.h>
int main()
{
int n,a,b,i;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d  %d",&a,&b);
if(a==b)
{
printf("These numbers are equal.\n");
}
......................
阅读全部 | 小神女 贴于 2020年10月24日 16:38     hide bbsi
#include<stdio.h>
int main()
{
    printf("hello");
    return 0;
}
阅读全部 | GWhoney 贴于 2020年10月14日 19:22     hide bbsi
#include <iostream>
using namespace std;
typedef struct PNODE{
int xs; int cs; PNODE *next;}pnode;
int CreateList(pnode* header,int n){
for(int i=1; i<=n; i++){ pnode *new_node = new pnode;//创建新节点 if (!new_node) { cout<<"创建失败"<<endl; return 0; }
new_node->next = nullptr; bool flag = true;//判断本次输入的数据是否已经存在相同次数项的标志 cout<<"请输入系数和次数:"; cin>> new_node->xs >> new_node->cs; pnode *s1 = header->next;
if (header->next==nullptr) { header->next = new_node; }
else { while(s1!=nullptr){//查找是否有相同次数的项 if(s1->cs==new_node->cs){//找到同次数的项 if(s1->xs+new_node->xs==0){//如果系数和为0 移除该节点 pnode *del = header->next; while (del->next!=s1){//找到前结点 del = del->next; } del->next = s1->next; delete s1,new_node; flag = false; break; }
else{//系数和不为0则 直接加 并且删除新节点 s1->xs += new_node->xs; delete s1,new_node; flag = false; break;  } }else{//该项次数不同则找下一个结点 s1 = s1->next; } }
if(flag){//没有同次数项则 直接在对应位置插入新节点 //查找该结点的前驱和后驱  s1 = header->next;//s1保存前驱的位置 pnode *s2;//s2保存后驱 s2 = s1;//从首元结点开始查找 if (s1==nullptr){//如果还没有数据则直接填入 header->next = new_node; new_node->next = nullptr; delete s1,s2; }
else{ while(s2!=nullptr && s2->cs < new_node->cs){//找到第一个比该节点次数大的项 s1 = s2; s2 = s2->next; }//如果没找到s1应该为最后一项,s2为空 new_node->next = s2; s1->next = new_node; } } } } return 0; }
......................
阅读全部 | 田何义 贴于 2020年10月11日 23:53     hide bbsi
上一页 83 84 85 86 87 88 89 90 91 92 下一页