<html>
<head>
<title>找最接近的数</title>
<meta charset="utf-8">
</head>
<body >
<p>
问题描述:有一堆若干金条,从中任选几条,使其重量之和与另一给定的数量最接近。
......................
阅读全部
|
LHY163311
贴于 2020年12月3日 18:43
hide
bbsi
#include <stdio.h>
#include<string.h>
enum course {KONG,tiyu,xianxingdaishu,weijifen,cyuyan,yingyu}sub;
int s,w;
int fun(int s,int w,enum course t[6][7])
{int p=0,q=0;
int i,j;
for(i=0;i<6;i++)
{for(j=0;j<7;j++)
{if(i==1&&j==0)
t[i][j]=tiyu;
else if(i==0&&j==2)
......................
阅读全部
|
lx1455172065
贴于 2020年11月22日 08:45
hide
bbsi
#include <stdio.h>
//结点类型定义
typedef struct Node
{
int data;
struct Node *next;
}Node,*LinkList; //
//主函数
int main()
{
int InitList(LinkList *L);
......................
阅读全部
|
average
贴于 2020年11月18日 20:43
hide
bbsi
#include <stdio.h>
#include <math.h>
int main ()
{
double a,b,c,deta,x1,x2,p,q;
scanf("%lf%lf%lf",&a,&b,&c);
deta=b*b-4*a*c;
p=-b/(2*a);
q=sqrt(deta)/(2*a);
x1=p+q;x2=p-q;
printf("x1=%7.2f+%-7.2fi\nx2=%7.2f-%-7.2fi\n",p,q,p,q);
return 0;
......................
阅读全部
|
韩锡秀
贴于 2020年11月9日 20:44
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