麻烦大神帮我看看我的C语言程序哪里出错了!谢谢!

可变分区最佳分配,我的程序运行以后,在第二项回收的时候会出现问题,麻烦帮解答
#include
#include
#define n 3 /*假定系统允许的最大作业数量为n*/
#define m 3 /*假定系统允许的空闲区表最大为m*/
#define minisize 100
struct
{
float address;/*已分分区起始地址*/
float length;/*已分分区长度,单位为字节*/
float endaddress; /*已分分区结束地址,单位为字节*/
int flag; /*已分分区表登记栏标志,用“0”表示空栏目,用一个字符表示作业名*/
}used_table[n]; /*已分分区表*/
struct
{
float address;/*空闲区起始地址*/
float length; /*空闲区长度,单位为字节*/
float endaddress;/*空闲区结束地址,单位为字节*/
int flag; /*空闲区登记栏标志,用“0”表示空栏目,用“1”表示未分配*/
}free_table[m]; /*空闲区表*/

allocate(J,xk)
char J;
float xk;
{
int i,k;
float ad;
k=-1;
for (i=0;i if (free_table[i].length>=xk&&free_table[i].flag==1)
if (k==-1||free_table[i].length k=i;
if (k==-1)
{
printf("无可用空闲区\n");
return;
}
if (free_table[k].length-xk {
free_table[k].flag=0;
ad=free_table[k].address;
xk=free_table[k].length;
}
else
{
free_table[k].length=free_table[k].length-xk;
ad=free_table[k].address+free_table[k].length;
}
i=0;
while (used_table[i].flag!=0&&i i++;
if (i>=n)
{
printf("无表目填写已分分区,错误\n");
if (free_table[k].flag==0)
free_table[k].flag=1;
else
free_table[k].length=free_table[k].length+xk;
return;
}
else
{
used_table[i].address=ad;
used_table[i].length=xk;
used_table[i].flag=J;
used_table[i].endaddress=ad+xk;
}
return;
}

reclaim(J)
char J;
{
int i,k,j,s,t;
float S,L;
s=0;
while ((used_table[s].flag!=J||used_table[s].flag==0)&&s s++;
if (s>=n)
{
printf("找不到该作业\n");
return;
}
used_table[s].flag=0;
S=used_table[s].address;
L=used_table[s].length;
j=-1;k=-1;i=0;
while (i {
if (free_table[i].flag==0)
{
if (free_table[i].address+free_table[i].length==S)k=i;
if (free_table[i].address==S+L)j=i;
}
i++;
}
if (k!=-1)
if (j!=-1)
{
free_table[i].length=free_table[j].length+free_table[k].length+L;
free_table[j].flag=0;
}
else
free_table[k].length=free_table[k].length+L;
else
if (j!=-1)
{
free_table[j].address=S;
free_table[j].length=free_table[j].length+L;
}
else
{
t=0;
while (free_table[t].flag==1&&t t++;
if (t>=m)
{
printf("内存空闲表没有空闲,回收空间失败\n");
used_table[s].flag=J;
return;
}
free_table[t].address=S;
free_table[t].length=L;
free_table[t].flag=1;
}
return 0;
}
void input(){
int i;
for(i=0;i<m;i++)
{
printf("请输入第%d个分区的起始地址:\n",i+1);
scanf("%f",&free_table[i].address);
printf("请输入第%d个分区的大小:\n",i+1);
scanf("%f",&free_table[i].length);
free_table[i].endaddress=free_table[i].address+free_table[i].length;
}
}
int main()
{
printf("共有%d个分区,请依次输入分区信息:\n",m);
int i,a;
float xk;
char J;
input();
for (i=0;i<m;i++)
{
free_table[i].flag=1;
}
for (i=0;i<n;i++)
{
used_table[i].flag=0;
used_table[i].endaddress=used_table[i].address+used_table[i].length;
}
while (1)
{
printf("----------请输入序号来选择功能(0~3):----------\n");
printf("(0-退出,1-分配内存,2-回收内存,3-显示内存)\n");
scanf("%d",&a);
switch (a)
{
case 0:exit(0);
case 1:
printf("输入作业名J和作业所需长度xk: ");
scanf("%*c%c%f",&J,&xk);
allocate(J,xk);
break;
case 2:
printf("输入要回收分区的作业名");
scanf("%*c%c",&J);
reclaim(J);
break;
case 3:
printf("输出空闲区表:\n起始地址 分区长度 结束地址 标志\n");
for (i=0;i <m;i++)
printf("%5.0f%10.0f %5.0f%6d\n",free_table[i].address,free_table[i].length,free_table[i].endaddress,free_table[i].flag);
printf("\n");
printf("输出已分分区表:\n起始地址 分区长度 结束地址 标志\n");
for (i=0;i <n;i++)
if (used_table[i].flag!=0)
printf("%6.0f%9.0f %5.0f%6d\n",used_table[i].address,used_table[i].length,used_table[i].endaddress,used_table[i].flag);
else
printf("%6.0f%9.0f %5.0f%6d\n",used_table[i].address,used_table[i].length,used_table[i].endaddress,used_table[i].flag);
break;
default:printf("没有该选项\n");
}
}
}

c
0

1个回答

从语句上看几个循环可能有问题:
while (used_table[i].flag!=0&&i i++;
while ((used_table[s].flag!=J||used_table[s].flag==0)&&s s++;
while (i {
while (free_table[t].flag==1&&t t++;

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
请帮我看看我哪里出错了
import java.applet.Applet;rnimport java.awt.Graphics;rnpublic class Sprit extends Applet rn public void paint(Graphics g)rn g.drawString("0到10的平方和立方值是:",20,20);rn int a[][]=new int[2][];rn int i;rn for (i=0;i<11;i++)rn a[0]=i*i;rn a[1]=i*i*i;rn for (i=0;i<11;i++)rn g.drawString(""+i+"的平方是:"+a[0],30,30+i);rn g.drawString(""+i+"的立方是:"+a[1],30,50+i);rn rnrn上面的程序可以编释成.class文件,但是运行(嵌入html)时没有结果出来?请问哪里出错了啊??今天晚上就要交作业了,各位大侠帮帮我吧!!先谢了!! :)rn
麻烦高手看看我这个触发器哪里出错了,谢谢
CREATE OR REPLACE TRIGGER BV.TRIGGER_MR_SHIP_ADDR_INSERTrnBEFORE INSERTrnON BV.MR_SHIP_ADDR rnREFERENCING NEW AS NEW OLD AS OLDrnFOR EACH ROWrnDECLARErnTEMP_OID INTEGER;rnTEMP_SALES_ID varchar(10);rnTEMP_AGENT_ID VARCHAR2(20);rnTEMP_SHIP_ID VARCHAR(20);rnTEMP_SHIP_ADDR VARCHAR(200);rntype MR_SHIP_ADDR_REC is record(rn V_PROD_GRP BV.DC_AGENTBUSIUNIT.BUSI_UNIT_ID%TYPE,rn V_SALES_ID BV.DC_AGENTBUSIUNIT.SALESORG_ID%TYPErn );rntype MR_SHIP_ADDR_CURSOR is ref cursor return MR_SHIP_ADDR_REC;rn MR_SHIP_ADDR_SELECT_CURSOR MR_SHIP_ADDR_CURSOR;rn MR_SHIP_ADDR_SELECT_RECORD MR_SHIP_ADDR_REC;rnrnrnBEGINrn TEMP_OID := :NEW.OID; rn TEMP_SHIP_ID := :NEW.SHIP_ALIAS;rn TEMP_SHIP_ADDR := :NEW.SHIP_ADDRESS; rn rnSELECT DC_ERP_AGENT_ID INTO TEMP_AGENT_ID FROM MR_ACCT_PROFILE WHERE OID=TEMP_OID; rnrnopen MR_SHIP_ADDR_SELECT_CURSOR for rnSELECT C.BUSI_UNIT_ID,C.SALESORG_ID FROM MR_ACCT_PROFILE A,DC_AGENTBUSIUNIT C WHERE A.ACCOUNT_NAME=C.AGENT_IDrnAND OID=TEMP_OID;rn rn IF MR_SHIP_ADDR_SELECT_CURSOR%ISOPEN THENrn LOOP rn FETCH MR_SHIP_ADDR_SELECT_CURSOR INTO MR_SHIP_ADDR_REC;rn EXIT WHEN MR_SHIP_ADDR_SELECT_CURSOR%NOTFOUND;rn INSERT INTO HP_HOMEPC_RT (SALE_GRP,AGENT_ID,SENDER_ID,HPID,PL,ADDRESS,MODIFY_TIME,MODIFY_NAME,CREATE_TIME)rn VALUES (MR_SHIP_ADDR_REC.V_SALES_ID,DC_ERP_AGENT_ID,TEMP_SHIP_ID,'',MR_SHIP_ADDR_REC.V_PROD_GRP,TEMP_SHIP_ADDR,SYSDATE,'system',SYSDATE);rn END LOOP;rn END IF;rnrnEND TRIGGER_MR_SHIP_ADDR_INSERT;
麻烦大家帮我看看我哪错了?
import java.sql.Connection;rnimport java.sql.SQLException;rnimport java.sql.DriverManager;rnimport java.util.Properties;rnimport java.io.File;rnimport java.io.FileInputStream;rnimport java.io.FileNotFoundException;rnimport java.io.IOException;rnrnpublic class DBManager rn rn Properties propInfo = new Properties();rn private Connection con = null;rn rn public Connection getConnection() rn try rn Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");rn con = DriverManager.getConnection("sa", "sa", "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=mydb");rn catch (ClassNotFoundException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn catch (SQLException sqle) rn sqle.printStackTrace();rn rn return con;rn rnrn大家帮忙看一下我哪错了,运行后的异常为rn"java.sql.SQLException: No suitable driverrn at java.sql.DriverManager.getConnection(Unknown Source)rn at java.sql.DriverManager.getConnection(Unknown Source)rn at com.basicapp.util.DBManager.getConnection(DBManager.java:30)rn at com.basicapp.util.Test.main(DBManager.java:58)";
看看我的程序哪里出错了
归并算法C语言,程序如下,但是运行结果就是不正确。大家给看看哪里出错了!rn[code=C/C++][/code]rn#include rn rn void merge(int a[], int p, int q, int r)rn rn int n1 = q-p+1;rn int n2 = r-q;rn int i=0, j=0;rn int k;rn /**//* 新创建两个辅助数组 */rn int L[6], R[6];rn printf("x %d y",a[1]);rn for (i=0; i
帮我看看我的服务程序哪出错了
帮我看看我的服务示例程序哪出错了,为什么不会启动,我也用SamplePrivDeveloper.pfx签了名,生成的DLL有数字签名,名称为TEST USE ONLY - Sample Privileged Developer - Windows Mobile SDKrn服务程序的签名也是用mapirule一样的签名方式吗?我的dll如果导出给我的程序用是可以的,求高人指点rnrn按要求改写了注册表rn// [HKEY_LOCAL_MACHINE\Services\MyService]rn// "Dll"="MyService.dll"rn// "Order"=dword:8rn// "Keep"=dword:1rn// "Prefix"="SRV"rn// "Index"=dword:0rn// "Context"=dword:0rn// "DisplayName"="Sample Service"rn// "Description"="This sample service makes your device beep about every 10 seconds."rn服务函数的入口rnMYSERVICE_API DWORD SRV_Init(DWORD dwData)rnrn MessageBox(NULL,_T("ffff"),_T("ffff"),MB_OK);rn MessageBeep(0xFFFFFFFF);rn thread = CreateThread(NULL,0,MyControllingFunction,0,0,0);rn return 1; rnrn//Application specific stuffrn//定时rnvoid CALLBACK MyTimerProc(rn HWND hWnd, // handle of CWnd that called SetTimerrn UINT nMsg, // WM_TIMERrn UINT nIDEvent, // timer identificationrn DWORD dwTime // system timern )rnrn //Beep every time the timer is triggered.rn MessageBeep(0xFFFFFFFF);rn;rnrn//rnDWORD WINAPI MyControllingFunction( LPVOID pParam )rnrnrn // This will call MyTimerProc about every seconds. It might take longerrn // as services run in the background. In this specific case MyTimerProc willrn // produce a beep about every ten seconds.rn m_nTimer = SetTimer(0, 0,1000, MyTimerProc); rn rn MSG msg;rn while (GetMessage(&msg, 0, 0, 0))rn rn TranslateMessage(&msg);rn DispatchMessage(&msg);rn rn return 0;rnrn
在线等,麻烦高人帮我看看我哪里错了,
谢谢大家了,这是题目:rn4. 编写函数实现删除一字符串中的‘*’,分两种情况实现,一种是另外开辟一个字符数组,一种是在原字符串上直接删除。并进行测试;rn(1)void delete(char s[],char t[]) // t中存放删除‘*’后的字符串rn(2)void delete(char s[])rn这是我写的代码~!rn#include rnusing namespace std;rnint main(void)rn char s[6] = "*****";rn char t[6];rn void delete1(char s[],char t[]);rn delete1(s,t);rn cout << t << endl;rn void delete2(char s[]);rn delete2(s);rn cout << s << endl;rn system("pause");rn return 0;rnrnrnvoid delete1(char s[],char t[])rn int i = 5;rn int j = 0;rn for (int k = 0; k <= i; ++k)rn if (s[k] != '*') rn rn t[j] = s[k];rn ++j;rn rn rn t[j] = '\0';rnrnvoid delete2(char s[])rn rn for (int k = 0; k <= 5; k++)rn if (s[k] == '*')rn int j = k;rn for(int i =k+1; i <= 5; i++,j++)rn s[j] = s [i];rn rnrndelete2 函数怎么不可以得到我想要的结果啊?~~!求助。。
求助大神看看我的队列方式哪里出错了
求助大神看看我的队列方式哪里出错了 #ifndef QUEUE_H #define QUEUE_H struct listnode{ int v; struct listnode* next; }; typedef struct listnode *plistnode; struct queue{ plistnode head; plistnode tail; }; typedef struc...
求大神帮我看看我这个程序哪出错了
#includernusing namespace std;rnclass Studentrn public:rn Student();rn Student(long,int);rn void display();rn friend void max(Student *p);rn private:rn long code;rn int score;rn;rnrnStudent::Student()rnStudent::Student(long co,int s)rnrn co=code;rn s=score;rnrnrnvoid Student::display()rnrn cout<score>max)rn max=(p+i)->score;rn cout<<"最好成绩:"<display();rnrnint main()rnrn int i;rn Student *p;rn Student Stu[5]=rn Student(1001,90),rn Student(1002,80),rn Student(1003,95),rn Student(1004,85),rn Student(1005,70),rn ;rn cout<<"输出:"<
请帮我看看我的代码哪里错了
用JAVA写的电子词典(数据库用ACCESS)界面可以运行出来,可数据库不能正常连接,请专家帮我看看.
帮我看看我的代码哪里错了?
Dim a As Stringrna = App.Path + "\zp" 'a="C:\Program Files\sky2006(考试系统)\zp"rnIf Dir(a) = "" Then '如果文件不存在就创建文件rnSet objFSO = CreateObject("Scripting.FileSystemObject")rnobjFSO.CreateFolder (a) '创建文件rnDim RetVal As Longrn RetVal = Shell("net share AAA=" & a & "", 0) '设置文件夹共享rn If RetVal = 0 Thenrn MsgBox ("Error")rn End IfrnEnd Ifrn为什么我写的代码不能让文件夹共享呢?可几创建文件夹rnrn
- -高手来帮我看看我哪里错了`
[code=C#]rn private void button1_Click(object sender, EventArgs e)rn rn double num1;//第一个计算数;rn double num2;//第二个计算数;rn double result; //结果rn num1 = double.Parse(txtnum1.Text);rn num2 = double.Parse(txtnum2.Text);rn rnrn if (txtnum1.Text!="")rn rn if (cbbOperator.Text!="")rn rn if (txtnum2.Text!="")rn rn  switch (cbbOperator.Text)rn rn case "+":rn result = num1 + num2;rn break;rn case "-":rn result = num1 - num2;rn break;rn case "*":rn result = num1 * num2;rn break;rn case "/":rn if (double.Parse( txtnum2.Text) != 0)rn rn result = num1 / num2;rn rn rn elsern rn MessageBox.Show("除数不能为0");rn rn break;rn case "%":rn if (double.Parse( txtnum2.Text)!=0)rn rn result = num1 % num2;rn rn elsern rn MessageBox.Show("除数不能为0");rn rn break;rn default:rn MessageBox.Show("请选择运算符");rn break;rn rnrn rn elsern rn MessageBox.Show("请输入第二个计算数");rn rn rn elsern rn MessageBox.Show("请输入运算符");rn rnrn rn elsern rn MessageBox.Show("请输入第一个计算数");rn rnrn rnrn我想输入空值```它就给我爆了``不知道怎么改哦`rn[/code]
请大虾们帮我看看我的翻页哪里出错了!!
public partial class UI_Employee_perOutput : System.Web.UI.Pagernrn public static string UserID = "";rn public static string ItemID = "";rn string sqlstr = "";rn string table = "";rn myMeans.myMean myMean = new myMeans.myMean();rn dzDB.Sql mySql = new dzDB.Sql();rn public DataSet myDataSet;rn protected void Page_Load(object sender, EventArgs e)rn rn if (!IsPostBack)rn rn if (Request.Cookies["UserID"] == null)rn Response.Redirect("../Login.aspx");rn UserID = Request.Cookies["UserID"].Value;rn ItemID = myMean.SearchById("select ItemID from Sys_Item where UserID='" + Request.Cookies["UserID"].Value + "'", "ItemID");rn ProName.Text = myMean.SearchById("select ItemName,ItemPlace from Sys_Item where ItemID='" + ItemID + "'", "ItemName", "ItemPlace");rn outPutTime.Text = System.DateTime.Now.ToShortDateString();rn tCurPage.Text = "1";rn sqlstr = "select eId,eName from Sys_Employee where eProId='" + ItemID + "'";rn table = "Sys_Employee";rn GridView_Bind(sqlstr, table);rn rn rnrn public void GridView_Bind(string sqlstr, string table)rn rn myDataSet = mySql.createDataSet(sqlstr, table);rn PagedDataSource PS = new PagedDataSource();rn PS.AllowPaging = true;rn PS.PageSize = 12;rn PS.CurrentPageIndex = int.Parse(tCurPage.Text) - 1;rn PS.DataSource = myDataSet.Tables[table].DefaultView;rn if (PS.CurrentPageIndex == 0)rn rn Previous.Enabled = false;rn Next.Enabled = true;rn else if (PS.CurrentPageIndex == PS.PageCount - 1)rn rn Next.Enabled = false;rn Previous.Enabled = true;rn elsern rn Next.Enabled = true;rn Previous.Enabled = true;rn SumPage.Text = "共" + PS.PageCount + "页";rn GridView1.DataSource = PS;rn GridView1.DataBind();rn rn错误信息:索引 12 不是为负数,就是大于行数。 GridView1.DataBind();这一行;rn我在数据库一样,我在本机上测试正常,但是网站放到服务器上就偶尔会报上面的错误。。。。请问该怎么办
帮我看看我的这个程序哪里出错了?
file Merge.hrnrnvoid Merge(int R[],int T[],int low,int mid,int high);rnvoid MergePass(int R[],int T[],int length,int n);rnvoid MergeSort(int R[],int n);rnrnfile Merge.cpprnrn#include "Merge.h"rnrnvoid Merge (int R[],int T[],int low ,int mid, int high)rnrn int i,j,k;rn i=low;j=mid+1;k=low;rn while( (i<=mid) && (j<=high) )rn rn if (R[i]<=R[j])rn T[k++]=R[i++];rn elsern T[k++]=R[j++];rn while( i<=mid )rn T[k++]=R[i++];rn while(j<=high)rn T[k++]=R[j++];rn rnrnrnvoid MergePass(int R[],int T[],int length,int n)rnrn int low,j;rn low=1;rn while( low+2*length-1<=n)rn rn Merge(R,T,low,low+length-1,low+2*length-1);rn low=low+2*length;rn rn if(low+length-1 < n)rn Merge(R,T,low,low+length-1,n);rn elsern for(j=low;j<=n;j++)rn T[j]=R[j];rnrnrnvoid MergeSort(int R[],int n)rnrn int length = 1;rn int T[20];rn while(length < n)rn rn MergePass(R,T,length,n);rn length=2*length;rn MergePass(T,R,length,n);rn length=2*length;rn rnrnrnfile mainrnrn#include rn#include "Merge.h"rnrnrnvoid main()rnrn int R[20];rn int choose;rn int n=20;rn cout<<"random input ? yes=1 or no=0 ?\n";rn cin>>choose;rn if (choose == 0)rn rn cout<<"please input 20 numbers less than 10^5\n";rn cin>>R[0]>>R[1]>>R[2]>>R[3]>>R[4]>>R[5]>>R[6]>>R[7]>>R[8]>>R[9]>>R[10]>>R[11]>>R[12]>>R[13]>>R[14]>>R[15]>>R[16]>>R[17]>>R[18]>>R[19]; rn rnrn MergeSort (R, n);rnrn错误信息!rnLinking...rnMerge_quick.obj : error LNK2001: unresolved external symbol "void __cdecl MergeSort(int * const,int)" (?MergeSort@@YAXQAHH@Z)rnDebug/Merge_quick.exe : fatal error LNK1120: 1 unresolved externalsrnError executing link.exe.rnrnMerge_quick.exe - 2 error(s), 0 warning(s)
大家帮我看看我的代码哪里出错了
是个用ASP读取CSV文件的代码rnSet objCon = Server.CreateObject("ADODB.Connection")rnSet objRs = Server.CreateObject("ADODB.Recordset")rnrnOn Error Resume NextrnobjCon.Open "Driver=Microsoft Text Driver (*.txt; *.csv);" &_rn "Dbq=" & Server.MapPath( "UploadFile\" ) & ";" &_rn "Extensions=asc,csv,tab,txt;" &_rn "Persist Security Info=False"rnrnobjRs.Open "SELECT * FROM c.csv order by 'A' desc",objCon,adOpenStatic,adLockReadOnly,adCmdTextrnrn我用objRs(0)或者是objRs("列表名")读取不到任何数据,大家帮我看看,谢谢啦~~~
大家帮我看看我在sqlite生成日期哪里出错了?
我要做的是生成日期,存储之后再读取显示出来,可我用下面三种种办法生成的都是乱码。不知道错在哪里了,请高手们指点。rn第一种方法:rnrnrc = sqlite3_exec(db, "CREATE TABLE software ([id] INTEGER PRIMARY KEY, "[year] date);", 0, 0, &zErrMsg);rnSYSTEMTIME systime;//获取系统时间rnchar value[128];rn sprintf(value, "insert into software(year) values('%d-%d-%d')",systime.wYear,systime.wMonth,systime.wDay);rn rc = sqlite3_exec(db, value, 0, 0, &zErrMsg);rn结果读取的是:2440-7-0rnrn第二种办法:rnrc = sqlite3_exec(db, "CREATE TABLE software ([id] INTEGER PRIMARY KEY, "[year] date);", 0, 0, &zErrMsg);rn CHAR chn[24]="select datetime('now')";//获取当前时间rn char value[128];rn sprintf(value, "insert into software(year) values('%d-%d-%d')",chn);rn结果读取的是:884450-0-886441 之类的乱码。rnrn第三种办法:rnrc = sqlite3_exec(db, "CREATE TABLE software ([id] INTEGER PRIMARY KEY, "[year] date);", 0, 0, &zErrMsg);rn char *time="select date('%Y-%m-%d')";rn rc=sqlite3_exec(db, "INSERT INTO software(year) VALUES('%d','%d','%d'),time",0,0,&zErrMsg);rn结果读取的是还是乱码。rn搞了一整天,都没成功,杯具啊。请高手帮帮小弟看看。rnrnrnrnrnrnrn
麻烦大神帮我看看哪里出错了(Java基础)
public class wwwn public static void main(String []args)n n n People p1=new People("小明",28,c1);n People p2=new People("小红",25,c1);n Baby c1=new Baby("宝贝",5);nn p1.renming();n c1.renming();nnnnnclass Peoplenn String name;n int age;n Baby baby;nn public People(String name,int age,Baby baba)n this.name=name;n this.age=age;n this.baby=baby;nn public void renming()n System.out.println("名字叫做:"+this.name);nnnnnclass Babynn String name;n int age;nn public Baby(String name,int age)n this.name=name;n this.age=age;nn public void renming()n System.out.println("婴儿的名字叫做"+this.name);nnnn
请大家看看我在哪里出错了,谢谢
private void Page_Load(object sender, System.EventArgs e)rn rn // 在此处放置用户代码以初始化页面rn int a;rn string ipaddr;rn ocmIpAddr.CommandText="SELECT CITYID FROM IPADDR WHERE rn IPADDR='"+ipaddr+"'";rn ocmIpAddr.Connection.Open();rn ocmIpAddr.ExecuteScalar();rn a=System.Convert.ToInt16(ocmIpAddr.ExecuteOracleScalar());rn ocmIpAddr.Connection.Close();rn ipaddr="";rn ipaddr=System.Convert.ToString(a);rn Labelcityname.Text=ipaddr;rnrn rnrnrna=System.Convert.ToInt16(ocmIpAddr.ExecuteOracleScalar());rn这句话老报错,请问我应该如何修改呢?谢谢各位.
麻烦看看我的程序错在哪里~~谢谢~~
是一个关于文字处理的程序,只需要实现光标左右移动以及插入即可~rn先贴一个我实现左右移动的程序,这个可以正确运行rndata segment rninput_char db ?rncurent_cursor db ?rndata endsrn;************************************************************rncode segment rnassume cs:code,ds:datarnmain proc farrnstart:rnmov ax,datarnmov ds,axrninput:rnmov ah,3 ;record the position of cursorrnint 10hrnmov curent_cursor,dl rnmov ah,0 ;waiting inputing keyrnint 16hrnmov input_char,ah ;record the code of the input characterrncmp ah,1ch ;is ENTER?rnje exit ;exitrncmp ah,4bh ;is left arrow?rnjne right ;if not,jump to rightrncall moveleft ;else call moveleftrnjmp input ;and input the next characterrnright:rnmov ah,input_char ;is right arrow?rncmp ah,4dh ;rnjne display ;if not,display itrncall moveright ;else call moverightrnjmp input ;and input the next characterrndisplay:rnmov ah,2 ;display the characterrnmov dl,alrnint 21hrnjmp inputrnexit:rnmov ah,4ch ;return to dosrnint 21hrnmain endprn;*********************************************************rnmoveleft proc nearrnpush axrnpush dxrnmov ah,2 ;reset the position of cursorrnmov dl,curent_cursorrndec dl rnint 10hrnmov curent_cursor,dl ;record the curent position of cursorrnpop dxrnpop axrnret ;returnrnmoveleft endprn;********************************************************rnmoveright proc nearrnpush axrnpush dxrnmov ah,2 ;reset the position of cursorrnmov dl,curent_cursorrninc dlrnint 10hrnmov curent_cursor,dl ;record the curent position of cursorrnpop dxrnpop axrnret ;returnrnmoveright endprnrncode endsrnend startrnrnrn以下是我依照前面的思路,将插入加上的程序,总是有问题~~rn我怀疑是指针的问题,可是实在找不出来,头都被乱晕了~~rnrndata segment rninput_char db ?rninput_code db ?rncursor dw ?rntemp dw ?rnarr db 80 dup(?)rndata endsrn;=============================================================rncode segment rnassume cs:code,ds:datarnmain proc farrnstart:rnmov ax,datarnmov ds,axrnmov ah,3 ;record the position of cursorrnint 10hrnmov di,dx ;put the last cursor into dirnmov si,dx ;put the curent cursor into sirnmov cursor,di ;the last cursorrnmov temp,si ;the curent cursorrncall insertrnmov ah,4ch ;return to dosrnint 21hrnmain endprn;============================================================rninsert proc nearrnpush axrnpush bxrnpush cxrnpush dxrninput:rnmov ah,0 ;waiting to input characterrnint 16hrnmov input_code,ah ;record the code and the ASCII of the input characterrnmov input_char,alrncmp ah,1ch ;is ENTER?rnje exit ;exitrncmp ah,4bh ;is left arrow?rnjne right ;if not,jump to rightrncall moveleft ;else call moveleftrnjmp input ;and input the next characterrnright:rnmov ah,input_code ;is right arrow?rncmp ah,4dh ;rnjne display ;if not,display itrncall moveright ;else call moverightrnjmp input ;and input the next characterrndisplay:rncall sort ;sort this charactersrncall output ;display themrnjmp inputrnexit:rnpop dxrnpop cxrnpop bxrnpop axrnretrninsert endprn;=====================================================rnsort proc nearrnpush axrnpush bxrnpush cxrnpush dxrnmov bx,offset arrrnmov di,cursor ;put the last cursor into dirnloop1:rncmp di,temp ;is the curent cursor the last one?rnje next ;rnmov dl,[bx][di] ;if not,resort the characters followed the curent cursorrnmov [bx][di+1],dl rndec di rnjmp loop1 rnnext: ;elsernmov dl,input_char ;put the input character into arr(temp)rnmov [bx][di],dlrnpop dxrnpop cxrnpop bxrnpop axrnsort endprn;=====================================================rnoutput proc nearrnpush axrnpush bxrnpush cxrnpush dxrnmov bx,offset arrrnmov si,temp ;init the loop conditionrnloop2:rnmov dl,[bx][si]rnmov ah,2 ;output the characters in the arrayrnint 21h ;from the curent cursorrncmp si,cursor ;to the last cursorrnje quit3rninc si rnjmp loop2rnquit3:rninc temp ;the curent cursor increasedrninc cursor ;the last cursor increased rn;mov ah,2rn;mov dx,temprn;int 10h ;set the curent cursorrnpop dxrnpop cxrnpop bxrnpop axrnretrnoutput endprn;=========================================================rnmoveleft proc nearrnpush axrnpush dxrnmov ax,sirncmp al,0 ;is the curent cursor the first one?rnje quit1 ;if yes,we cann't move the cursor to leftrnmov ah,2 ;reset the position of cursorrnmov dx,sirndec dx rnint 10hrnmov si,dx ;record the curent position of cursorrnquit1:rnpop dxrnpop axrnret ;returnrnmoveleft endprn;============================================================rnmoveright proc nearrnpush axrnpush dxrn;mov ax,sirncmp si,di ;is the curent cursor the last one?rnje quit2 ;if yes,we cann't move the cursor to rightrnmov ah,2 ;reset the position of cursorrnmov dx,sirninc dxrnint 10hrnmov si,dx ;record the curent position of cursorrnquit2:rnpop dxrnpop axrnret ;returnrnmoveright endprnrncode endsrnend startrnrnrn恳请各位帮我看看是哪里出了问题,感激不尽~~~rnrn不好意思,E文很弱,见笑了~~rn
麻烦帮我看一段SQL哪里错了?
[code=SQL]rnUPDATE QTEMP . TEMPPLANDATA_01F_2rnSET ( RQTY , SETQTY )rn= ( SELECT CAST ( SUM ( EPTRQT ) / 10000 AS DECIMAL ( 14 , 8 ) ) AS RQTY , CAST ( SUM ( EPTRQT ) / 10000 AS DECIMAL ( 14 , 8 ) ) AS SETQTY FROM PRODDTA . F4211rnWHERE SDDCTO = EPDCTO AND SDDOCO = EPDOCO AND SDKCOO = EPKCOO AND SDLNID = EPLNID AND SDLTTR <>'980' AND SDNXTR >='543' GROUP BY EPMCU , EPDTBG , EPKITL )rnWHERE EXISTS ( SELECT 1 FROM PRODDTA . F4211 WHERE SDDCTO = EPDCTO AND SDDOCO = EPDOCO AND SDKCOO = EPKCOO AND SDLNID = EPLNID AND SDLTTR <>'980' AND SDNXTR >='543')rn[/code]rn报错: [SQL0206] Column EPKITL not in specified tables. rn其中QTEMP . TEMPPLANDATA_01F_2是一张临时表,有EPMCU , EPDTBG , EPKITL等几个字段。
帮我看看 哪里出错了,求大神!!
message rndescription The server encountered an internal error () that prevented it from fulfilling this request.rnexception rnjavax.servlet.ServletException: java.lang.NullPointerExceptionrn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)rn org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)rn com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)rn com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)rn org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)rn org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)rn org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)rn org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)rnroot cause rnrnjava.lang.NullPointerExceptionrn com.demo.struts2.actions.LoginAction.execute(LoginAction.java:36)rn sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn java.lang.reflect.Method.invoke(Unknown Source)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)rn com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)rn com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)rn com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)rn rnnote The full stack trace of the root cause is available in the JBoss Web/2.1.1.GA logs.rn
javascript 大神帮我看一下哪里出错了
rnrnrn rn 无标题文档rn rnrnrnrn rn 你喜欢喝哪一种咖啡呀rn 拿铁 rn蓝山咖啡 rn卡布奇洛 rn爱尔兰咖啡 rnrnrnrnrn
麻烦帮我看看我的sql语句错在哪里,谢谢
CREATE VIEW ss AS (SELECT client.cname, supplier.sname. SUM(selldetail.squa)rn FROM dbo.sell INNER JOINrn dbo.selldetail ON rn dbo.sell.seno = dbo.selldetail.seno INNER JOINrn dbo.client ON dbo.sell.cno = dbo.client.cno INNER JOINrn dbo. product ON rn dbo.selldetail.pno = dbo. product .pno INNER JOINrn dbo.supplier ON dbo. product .sno = dbo.supplier.snorn GROUP BY client.cname, supplier.sname)rn SELECT ss.cname, ss.sname, MAX(ss.squa)rn FROM ssrnwhere(ss.cname,ss.sname,ss.squa) in rn(select ss.cname,max(ss.squa)rn from ssrn GROUP BY ss.cname)rnrn我所需要实现的客户购买哪所供应商的商品最多。client是客户表,supplier是供应商表,selldetail销售明细表
看看我的题哪里出错了,我刚学C
我刚学C请各位朋友帮帮忙看一下哪里错了!rn#includernvoid mian()rnrn char name;rn double basic,daper,bonper,loandet,salary;rn printf("请输入姓名");rn scanf("%c",&name);rn printf("请输入基本工资");rn scanf("%lf",&basic);rn printf("请输入百分比");rn scanf("%lf",&daper);rn printf("请输入奖金");rn scanf("%lf",&bonper);rn printf("请输入贷款");rn scanf("%lf",&loandet);rn salary=basic+basic*daper/100+bonper*basic/100-loandet;rn scanf("%lf",&salary);rn printf("姓名\t",name);rn printf("基本工资\t",basic);rn printf("实发工资\t",salary);rnrn
谁能帮我看看是哪里出错了
[code=Java][/code]package cn.edu.servlet;rnrnimport java.io.IOException;rnrnrnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnimport cn.edu.dao.StudentDAO;rnimport cn.edu.entity.Student;rnrnrnpublic class SeaechStudentServlet extends HttpServlet rnrn /**rn * rn */rn private static final long serialVersionUID = 1L;rn public void doGet(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rnrn this.doPost(request, response);rnrnrnrnpublic void doPost(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rnrn request.setCharacterEncoding("gb2312");rn response.setContentType("text/html; charset=gb2312");rn StudentDAO studentDAO = new StudentDAO();rn rn rn String queryType = request.getParameter("queryType");rn Student students = null;rn rn if("queryStudent".equals(queryType))rn String sId = request.getParameter("sId");rn rn students = studentDAO.queryById(sId);rn rn request.setAttribute("students", students);rn request.getRequestDispatcher("search.jsp").forward(request, response);rn rnrnrn[code=Java][/code]rn然后就说找不到SearchStudentServlet
大神帮忙看下哪里出错了!谢谢
编译出错,显示C0031: syntax errorrnstring ccname,ccnornc_info = upper(sle_1.text)rnif c_info= "" thenrn MessageBox("出错", "请输入课程号!")rnelsern select c.cname into :ccname from c where c.cno =: c_inforn if SQLCA.SQLCODE<> 0 thenrn MessageBox("出错", "此课程号不存在!")rn elsern select sc.cno into ccno from sc where (sc.cno=:c_info and rnsc.sno=:s_info);rn if SQLCA.SQLCODE = 0 thenrn MessageBox("出错", "此课程已存在!")rn elsern INSERT INTO sc(sno,cno)rn VALUES (:s_info, :c_info);rn dw_4.reset()rn sle_1.text=" "rn dw_4.settransobject(sqlca)rn dw_4.retrieve(s_info)rn end ifrn end ifrnend if
看看我哪里配错了?
使用jdbc连接数据库时出错,怀疑是环境配置出错rn环境变量rnJAVA_HOME=/usr/java/j2sdk1.4.2_05rnexport JAVA_HOMErnPATH=$JAVA_HOME/bin:$PATHrnexport PATHrnCLASSPATH=./:/opt/msSQLjdbc/lib/msbase.jar:/opt/msSQLjdbc/lib/mssqlserver.jar:/opt/msSQLjdbc/lib/msutil.jarrnexport CLASSPATHrnrn程序:rn public static Connection getConnection() throws SQLException, IOExceptionrn rn rn Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");rn return DriverManager.getConnection ("jdbc:microsoft:sqlserver://192.168.1.101:1433;User=sa");rn rn出错提示:rnjavac jdbcTest.javarnjdbcTest.java:34: unreported exception java.lang.ClassNotFoundException; must be caught or declared to be thrownrn Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");rnrnrn恩,ms SQL server 2000 for jdbc 装在/opt/msSQLjdbc下,打开mssqlserver.jar可以找到调试com.microsoft.jdbc.sqlserver.SQLServerDriver,恩大小写没错,恩在linux下.请大家帮忙看看怎么回事.调试通过马上结帖
帮我看看我的代码错在哪里,谢谢!
import java.applet.*;rnimport java.awt.*;rnrnpublic class EpSrchUI extends Appletrnrn static String strError1 = "no Error1";rnrn static private int m_nBID = 0; static private int m_nSpos = 0; static private int m_nPageSize= 10;rnrn public void init() rn rn rnrn public void start()rn rn tryrn rn nativeClass theSrchcall = new nativeClass();rn String com_strSrchText = "print";rn byte byteSrchText[] = com_strSrchText.getBytes();rnrn String com_InstallDir = "0721:HTMLG720";rn byte byteInstallDir[] = com_InstallDir.getBytes();rn rn int nRet = 0;rnrn byte byteSrchResult[] = theSrchcall.EDMacSearch(byteSrchText, byteInstallDir, m_nBID, 0, 0, "", "", 0, m_nSpos, m_nPageSize);rn String strRetFromJNI = new String(byteSrchResult);rn strError1 = strRetFromJNI;rn rn catch(Exception ce)rn rn strError1 = ce.toString();rn rn repaint(); rn rnrn //Error paintrn public void paint(Graphics g)rn rn g.drawString(strError1,10,10);rn rnrnrnclass nativeClassrnrn public native byte[] EDMacSearch(byte[] srch_txt, byte[] instdir, int bunrui, int db_id, int opt_id, String machine_id, String os_id, int level_id, int spos, int num);rnrn nativeClass()rn rn tryrn rn System.loadLibrary("SrchCall");rn rn catch(Exception le)rn rn System.out.println(le.toString());rn rn rnrnrn以上是我的代码,请问错在哪里?rn
看看我的sql哪里错了
USE pubsrnDECLARE @mytable sql_variantrnset @mytable = 'authors'rnSELECT *rnFROM @mytablern___________________________________________rn服务器: 消息 137,级别 15,状态 2,行 5rn必须声明变量 '@mytable'。
帮我看看程序哪里出错了!!谢谢。。
[code=C/C++][/code]rn#include rnrnusing namespace std;rnrnclass Operationrnrnpublic:rn virtual void setNum(double m, double n) = 0;rn virtual double getResult() = 0;rnprotected:rn double NumA ;rn double NumB ;rn;rnrnclass OperationAdd : public Operationrnrnpublic:rn void setNum(double m, double n) NumA = m; NumB = n; rn double getResult() return NumA + NumB ; rn;rnrnclass OperationFactoryrnrnpublic:rn static Operation* createOperate(char operate);rnrn;rnrnOperation* OperationFactory::createOperate(char operate)rnrn Operation* ptr_temp = NULL;rn switch(operate)rn rn case '+':rn OperationAdd operAdd;rn ptr_temp = &operAdd;rn break;rnrn rn return ptr_temp;rnrnrnint main()rnrn OperationFactory operFac; rn Operation *ptr_oper = operFac.createOperate('+');rnrn ptr_oper->setNum(3,6);rn double res = ptr_oper->getResult();rn cout<
帮我看看我错在哪里
<%rnSet conn = Server.CreateObject("ADODB.Connection")rnconn.Open "driver=Microsoft Access Driver (*.mdb);dbq="&Server.MapPath("data.mdb")rnaaa="select * from author where id='" &request.Form("authorid")&"'"rnset rs=server.CreateObject("adodb.recordset")rnrs.open aaa,conn,1,3rnrs("author")=request.Form("author")rnrs("authorname")=request.Form("authorname")rnrs("authorkeyword")=request.Form("authorkeyword")rnrs("authorseo")=request.Form("authorseo")rnrs.updaternrs.closernset rs=nothingrnconn.closernset conn=nothingrn%>rn出现问题如下提示:rnMicrosoft OLE DB Provider for ODBC Drivers 错误 '80040e10'rn[Microsoft][ODBC Microsoft Access 驱动程序] 参数不足,期待是 1。rn/gl/xgauthor.asp,行 6rn
帮我看看我错在哪里?
下边的代码执行BitBtn1Click时出现"Variant is not an array"错误rnrnunit utThread;rnrninterfacernrnusesrn Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,rn Dialogs, StdCtrls, Buttons, DB, DBClient, MConnect, SConnect, Grids,rn DBGrids;rnrntypern TfmMain = class(TForm)rn DBGrid1: TDBGrid;rn SocketConnection1: TSocketConnection;rn ClientDataSet1: TClientDataSet;rn DataSource1: TDataSource;rn BitBtn1: TBitBtn;rn procedure BitBtn1Click(Sender: TObject);rn privatern Private declarations rn publicrn Public declarations rn procedure OpenTable();rn end;rnrn TopenData = class(TThread)rn privatern Private declarations rn protectedrn procedure Execute; override;rn end;rnrnvarrn fmMain: TfmMain;rnrnimplementationrnrn$R *.dfmrnprocedure TfmMain.OpenTable();rnbeginrnClientDataSet1.Active:=false;rnClientDataSet1.Active:=true;rnend;rnprocedure TopenData.Execute;rnbeginrn Place thread code here rn fmMain.OpenTable;rnend;rnrnprocedure TfmMain.BitBtn1Click(Sender: TObject);rnvarrn newThread:TopenData ;rnbeginrn newThread:=TopenData.Create(false);rnend;rnrnend.rnrn
帮我看看我错在哪里???
rn 全部显示rn <%rn set rs=server.CreateObject("adodb.recordset")rn rs.Open "select * from Smart_culture_anclass order by anclassidorder desc",conn,1,1rn while not rs.eofrn %>rn <%if rs("anclassid")=request("anclassid") then%>selected<%end if%>><%=rs("anclass")%>rn <%rn response.Write " "rn rs.movenextrn wendrn rs.closern set rs=nothingrn %>rn
麻烦高手帮忙看看我这个触发器哪里出错了,谢谢
CREATE OR REPLACE TRIGGER BV.TRIGGER_MR_SHIP_ADDR_INSERTrnBEFORE INSERTrnON BV.MR_SHIP_ADDR rnREFERENCING NEW AS NEW OLD AS OLDrnFOR EACH ROWrnDECLARErnTEMP_OID INTEGER;rnTEMP_SALES_ID varchar(10);rnTEMP_AGENT_ID VARCHAR2(20);rnTEMP_SHIP_ID VARCHAR(20);rnTEMP_SHIP_ADDR VARCHAR(200);rntype MR_SHIP_ADDR_REC is record(rn V_PROD_GRP BV.DC_AGENTBUSIUNIT.BUSI_UNIT_ID%TYPE,rn V_SALES_ID BV.DC_AGENTBUSIUNIT.SALESORG_ID%TYPErn );rntype MR_SHIP_ADDR_CURSOR is ref cursor return MR_SHIP_ADDR_REC;rn MR_SHIP_ADDR_SELECT_CURSOR MR_SHIP_ADDR_CURSOR;rn MR_SHIP_ADDR_SELECT_RECORD MR_SHIP_ADDR_REC;rnrnrnBEGINrn TEMP_OID := :NEW.OID; rn TEMP_SHIP_ID := :NEW.SHIP_ALIAS;rn TEMP_SHIP_ADDR := :NEW.SHIP_ADDRESS; rn rnSELECT DC_ERP_AGENT_ID INTO TEMP_AGENT_ID FROM MR_ACCT_PROFILE WHERE OID=TEMP_OID; rnrnopen MR_SHIP_ADDR_SELECT_CURSOR for rnSELECT C.BUSI_UNIT_ID,C.SALESORG_ID FROM MR_ACCT_PROFILE A,DC_AGENTBUSIUNIT C WHERE A.ACCOUNT_NAME=C.AGENT_IDrnAND OID=TEMP_OID;rn rn IF MR_SHIP_ADDR_SELECT_CURSOR%ISOPEN THENrn LOOP rn FETCH MR_SHIP_ADDR_SELECT_CURSOR INTO MR_SHIP_ADDR_REC;rn EXIT WHEN MR_SHIP_ADDR_SELECT_CURSOR%NOTFOUND;rn INSERT INTO HP_HOMEPC_RT (SALE_GRP,AGENT_ID,SENDER_ID,HPID,PL,ADDRESS,MODIFY_TIME,MODIFY_NAME,CREATE_TIME)rn VALUES (MR_SHIP_ADDR_REC.V_SALES_ID,DC_ERP_AGENT_ID,TEMP_SHIP_ID,'',MR_SHIP_ADDR_REC.V_PROD_GRP,TEMP_SHIP_ADDR,SYSDATE,'system',SYSDATE);rn END LOOP;rn END IF;rnrnEND TRIGGER_MR_SHIP_ADDR_INSERT;
我编写的数据扩边程序,大神们帮我看看我哪里出错了
#includern#includern#includern#includern#define X 10rn#define Y 9rnvoid main()rnrn FILE *in,*out1,*out2;rn char ch,infile[10],outfile1[10],outfile2[10];rn int i,j;rn double a[101][101],b[105][105],c[101][101],d[101][101];rn double e;rn /*读文件*/rn printf("input the name of infile:\n");rn scanf("%s",infile);rn if((in=fopen(infile,"r"))==NULL);rn printf("cannot open file\n");rn exit(0);rnch=getchar();rn fread(a[0],sizeof(a[101][101]),4,in);rn /*存数据*/rn for(i=0;i<102;i++)rn for(j=0;j<102;j++)rn b[i+2][j+2]=a[i][j];rn /*扩边*/rn for(j=1;j>=0;j--)rn for(i=2;i<104;i++)rn b[i][j]=2*b[i][j+1]-b[i][j+2];rn for(j=104;j<=105;j++)rn for(i=2;i<104;i++)rn b[i][j]=2*b[i][j-1]-b[i][j-2];rn for(i=1;i>=0;i--)rn for(j=0;j<106;j++)rn b[i][j]=2*b[i-1][j]-b[i-2][j];rn for(i=104;i<106;i++)rn b[i][j]=2*b[i+1][j]-b[i+2][j];rn printf("input the size of angle(radian):\n"); rn scanf("%f",&e);rn /*对数据进行一阶求导*/rn for(i=0;i<102;i++)rn for(j=0;j<102;j++)rn c[i][j]=((b[i+2][j+3]-b[i+2][j+1])/(2*X))*cos(e)+((b[i+1][j+2]-b[i+3][j+2])/(2*Y))*sin(e);rn /*对数据进行二阶求导*/rn for(i=0;i<102;i++)rn for(j=0;j<102;j++)rn d[i][j]=((b[i-2][j-1]-2*b[i-2][j-2]+b[i-2][j-3])/(X*X))*cos(e)*cos(e)+((b[i-3][j-1]-b[i-3][j-3]-b[i-1][j-3]-b[i-3][j-3])/(4*X*Y))*1/2*sin(2*e)+((b[i-3][j-2]-2*b[i-2][j-2]+b[i-1][j-2])/(Y*Y))*sin(e);rn rn printf("input the name of outfile1:\n");rn scanf("%s",outfile1);rn if((out1=fopen(outfile1,"w"))==NULL);rn printf("cannot open file\n");rn exit(0);rnch=getchar();rn fwrite(c[0],sizeof(c[101][101]),4,out1);rn printf("input the name of outfile2:\n");rnscanf("%s",outfile2);rn if((out2=fopen(outfile2,"w"))==NULL);rn printf("cannot open file\n");rn exit(0);rnch=getchar();rn fwrite(d[0],sizeof(d[101][101]),4,out2);rnrnrnfclose(in);rnfclose(out1);rnfclose(out2);rnrn
帮我看看哪里出错了??
给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出。rnrn输入格式:测试输入包含一个测试用例,在一行内给出总长度不超过80的字符串。字符串由若干单词和若干空格组成,其中单词是由英文字母(大小写有区分)组成的字符串,单词之间用1个空格分开,输入保证句子末尾没有多余的空格。rnrn输出格式:每个测试用例的输出占一行,输出倒序后的句子。rnrn输入样例:rnHello World Here I Comern输出样例:rnCome I Here World Hellornrn这是题目rnrn[code=c]#include rn#include rn#define SIZE 80rnchar *s_gets(char *str,unsigned short n);rnrnint main(void)rn char a[SIZE];rn short i,j,k;rnrn s_gets(a,SIZE);rn i=strlen(a)-1;rn while(i)rn k=i;rn while(a[i]!=' ' && i>=0)rn i--;rn rn for(j=i+1;j<=k;j++)rn putchar(a[j]);rn i--;rn rnrn return 0;rnrnrnchar *s_gets(char *str,unsigned short n)rn char *p;rn unsigned short i=0;rnrn p=fgets(str,SIZE,stdin);rn if(p)rn while(p[i]!='\n' && p[i]!='\0')rn i++;rn if(p[i]=='\n')rn p[i]='\0';rn elsern while(getchar()!='\n')rn continue;rn rnrn return p;rnrn[/code]rnrn[img=https://img-bbs.csdn.net/upload/201804/13/1523590704_864240.png][/img]
帮我看一下哪里出错了??????????
[code=VBScript]rnsql="select a.con_pro_class,case(case(b.wc_num*100.0/(case when c.pc_num=0 or c.pc_num is null then 1 else c.pc_num end) as numeric(9,2)) as varchar)+'%' as e_cash1,"rn sql=sql & "case(case(d.wc_num*100.0/(case when e.pc_num=0 or e.pc_num is null then 1 else e.pc_num end) as numeric(9,2)) as varchar)+'%' as e_cash2,"rn sql=sql & "case(case(f.wc_num*100.0/(case when g.pc_num=0 or g.pc_num is null then 1 else g.pc_num end) as numeric(9,2)) as varchar)+'%' as e_cash3,"rn sql=sql & "case(case(h.wc_num*100.0/(case when i.pc_num=0 or i.pc_num is null then 1 else i.pc_num end) as numeric(9,2)) as varchar)+'%' as e_cash4,"rn sql=sql & "case(case(j.wc_num*100.0/(case when k.pc_num=0 or k.pc_num is null then 1 else k.pc_num end) as numeric(9,2)) as varchar)+'%' as e_cash5,"rn sql=sql & "case(case(l.wc_num*100.0/(case when m.pc_num=0 or m.pc_num is null then 1 else m.pc_num end) as numeric(9,2)) as varchar)+'%' as e_cash6,"rn sql=sql & "case(case(n.wc_num*100.0/(case when o.pc_num=0 or o.pc_num is null then 1 else o.pc_num end) as numeric(9,2)) as varchar)+'%' as e_cash7,"rn sql=sql & "case(case(p.wc_num*100.0/(case when q.pc_num=0 or q.pc_num is null then 1 else q.pc_num end) as numeric(9,2)) as varchar)+'%' as e_cash8,"rn sql=sql & " from (select distinct con_pro_class from sale_tbl_contact) as a" rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_fin_num) as wc_num from sale_tbl_contact where (wc_date bwtween '"&date_1&"' and '"&date_2&"') and (wc_date between '"&date_1y&"-1-1' and '"&date_2y&"-1-31') group by con_tbl_class) as b on a.con_tbl_class=b.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_num) as pc_num from sale_tbl_contact where (pc_date bwtween '"&date_1&"' and '"&date_2&"') and (pc_date between '"&date_1y&"-1-1' and '"&date_2y&"-1-31') group by con_tbl_class) as c on a.con_tbl_class=c.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_fin_num) as wc_num from sale_tbl_contact where (wc_date bwtween '"&date_1&"' and '"&date_2&"') and (wc_date between '"&date_1y&"-2-1' and '"&date_2y&"-2-29') group by con_tbl_class) as d on a.con_tbl_class=d.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_num) as pc_num from sale_tbl_contact where (pc_date bwtween '"&date_1&"' and '"&date_2&"') and (pc_date between '"&date_1y&"-2-1' and '"&date_2y&"-2-29') group by con_tbl_class) as e on a.con_tbl_class=e.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_fin_num) as wc_num from sale_tbl_contact where (wc_date bwtween '"&date_1&"' and '"&date_2&"') and (wc_date between '"&date_1y&"-3-1' and '"&date_2y&"-3-31') group by con_tbl_class) as f on a.con_tbl_class=f.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_num) as pc_num from sale_tbl_contact where (pc_date bwtween '"&date_1&"' and '"&date_2&"') and (pc_date between '"&date_1y&"-3-1' and '"&date_2y&"-3-31') group by con_tbl_class) as g on a.con_tbl_class=g.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_fin_num) as wc_num from sale_tbl_contact where (wc_date bwtween '"&date_1&"' and '"&date_2&"') and (wc_date between '"&date_1y&"-4-1' and '"&date_2y&"-4-30') group by con_tbl_class) as h on a.con_tbl_class=h.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_num) as pc_num from sale_tbl_contact where (pc_date bwtween '"&date_1&"' and '"&date_2&"') and (pc_date between '"&date_1y&"-4-1' and '"&date_2y&"-4-30') group by con_tbl_class) as i on a.con_tbl_class=i.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_fin_num) as wc_num from sale_tbl_contact where (wc_date bwtween '"&date_1&"' and '"&date_2&"') and (wc_date between '"&date_1y&"-5-1' and '"&date_2y&"-5-31') group by con_tbl_class) as j on a.con_tbl_class=j.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_num) as pc_num from sale_tbl_contact where (pc_date bwtween '"&date_1&"' and '"&date_2&"') and (pc_date between '"&date_1y&"-5-1' and '"&date_2y&"-5-31') group by con_tbl_class) as k on a.con_tbl_class=k.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_fin_num) as wc_num from sale_tbl_contact where (wc_date bwtween '"&date_1&"' and '"&date_2&"') and (wc_date between '"&date_1y&"-6-1' and '"&date_2y&"-6-30') group by con_tbl_class) as l on a.con_tbl_class=l.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_num) as pc_num from sale_tbl_contact where (pc_date bwtween '"&date_1&"' and '"&date_2&"') and (pc_date between '"&date_1y&"-6-1' and '"&date_2y&"-6-30') group by con_tbl_class) as m on a.con_tbl_class=m.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_fin_num) as wc_num from sale_tbl_contact where (wc_date bwtween '"&date_1&"' and '"&date_2&"') and (wc_date between '"&date_1y&"-7-1' and '"&date_2y&"-7-31') group by con_tbl_class) as n on a.con_tbl_class=n.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_num) as pc_num from sale_tbl_contact where (pc_date bwtween '"&date_1&"' and '"&date_2&"') and (pc_date between '"&date_1y&"-7-1' and '"&date_2y&"-7-31') group by con_tbl_class) as o on a.con_tbl_class=o.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_fin_num) as wc_num from sale_tbl_contact where (wc_date bwtween '"&date_1&"' and '"&date_2&"') and (wc_date between '"&date_1y&"-8-1' and '"&date_2y&"-8-31') group by con_tbl_class) as p on a.con_tbl_class=p.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_num) as pc_num from sale_tbl_contact where (pc_date bwtween '"&date_1&"' and '"&date_2&"') and (pc_date between '"&date_1y&"-8-1' and '"&date_2y&"-8-31') group by con_tbl_class) as q on a.con_tbl_class=q.con_pro_class"rn sql=sql & " LEFT OUTER JOIN (select con_pro_class,sum(e_fin_num) as wc_num from sale_tbl_contact where (wc_date bwtween '"&date_1&"' and '"&date_2&"') and (wc_date between '"&date_1y&"-9-1' and '"&date_2y&"-9-30') group by con_tbl_class) as r on a.con_tbl_class=r.con_pro_class"rn Set rs=Server.CreateObject("ADODB.RecordSet") rn rs.Open sql,Conn,3,1rn[/code]rn我写的这个语句运行时总提示:“as”附近有语法错误,我也找不出来哪里错了?有没有人能帮我看一下么??????
帮我看看 哪里出错了
[code=VB.NET]rn e.Row.Attributes.Add("onclick", String.Format("javascript:document.getElementById('0').click()", e.Row.Cells(0).FindControl("btnDetial").ClientID))rnrn[/code]rnrn错误:rnObject reference not set to an instance of an object.
麻烦看一下哪里错了,谢谢
#includern#includernstruct studentrn int age;rn struct student *next;rn;rnrnvoid main()rnrn void disp(struct student *head);rn struct student *list()rn int age1;rn struct student *head,*pnew,*tail;rn head=(struct student *)malloc(sizeof(struct student));rn if(head==NULL)rn rn printf("error");rn return;rn rn head->next=NULL;rn tail=head;rn while(age1!=0)rn rnrn printf("input age=");rn scanf("%d\n",&age1); rn pnew=(struct student *)malloc(sizeof(struct student));rn pnew=tail->next;rn pnew->age=age1;rn pnew->next=NULL;rn tail=pnew;rn rn rn disp(head);rnrnvoid disp(struct student *head)rnrn struct student *p=head;rn while(p!=NULL)rn rn printf("%d",p->age);rn p=p->next;rn rn
Help!typedef的问题, 麻烦帮忙看看我哪里错了
编译时报list 和 plist 用错了,但同样的定义法,node和pnode并没有错rn问题在哪?rnrnrn#include rntypedef struct DListNode rn int value; rn struct DListNode *prev, *next; rn node,* pnode;rnrntypedef struct DListrn struct DListNode head;rn int size;rn list,* plist;rnrnrnpnode newNode(int v,pnode prev, pnode next)rnrn node newNode = v, prev, next;//这个地方没错rn pnode pnewNode = &newNode; //这个地方没错rnrn return pnewNode;rnrnrnplist newList()rn pnode head = newNode(-1, NULL, NULL);rn head->next = head;rn head->prev = head;rn list newList = head, 0; //但这个地方就错了rn plist pnewList = &newList;//但这个地方就错了rn return pnewList;rnrnrnrnE:\Program Files\Microsoft Visual Studio\MyProjects\ics_lab0\DList.c(35) : error C2275: 'list' : illegal use of this type as an expressionrn E:\Program Files\Microsoft Visual Studio\MyProjects\ics_lab0\DList.c(21) : see declaration of 'list'rnrnE:\Program Files\Microsoft Visual Studio\MyProjects\ics_lab0\DList.c(36) : error C2275: 'plist' : illegal use of this type as an expressionrn E:\Program Files\Microsoft Visual Studio\MyProjects\ics_lab0\DList.c(21) : see declaration of 'plist'
麻烦帮我看看错在哪里
unit Unit4;rnrninterfacernrnusesrn Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,rn Dialogs, StdCtrls;rnrntypern TForm1 = class(TForm)rn Button1: TButton;rn procedure Button1Click(Sender: TObject);rn privatern Private declarations rn publicrn Public declarations rn end;rnrnvarrn Form1: TForm1;rnrnimplementationrnrn$R *.dfmrnrnprocedure TForm1.Button1Click(Sender: TObject);rnvarrn List1: array[0..3] of Double;rn List2: array[5..17] of Double;rn X: Word;rn S, TempStr: string;rnbeginrn for X := Low(List1) to High(List1) dorn List1[X] := X * 3.4;rn for X := Low(List2) to High(List2) dorn List2[X] := X * 0.0123;rn Str(Sum(List1):4:2, S);rn S := 'Sum of List1: ' + S + #13#10;rn S := S + 'Sum of List2: ';rn Str(Sum(List2):4:2, TempStr);rnrn S := S + TempStr;rn MessageDlg(s,mtcustom, [mbOk], 0);rnend;rnrnfunction Sum( var X: array of Double): Double;rnrnvarrn I: Word;rn S: Real;rnbeginrn S := 0; Note that open array index range is always zero-based. rn for I := 0 to High(X) do S := S + X[I];rn Result := S;rnend;rnend.rnrn错误提示:[Error] Unit4.pas(37): Undeclared identifier: 'Sum'

相似问题

2
c语言实现二叉树,碰到些问题,希望大神可以指导我解决,到程序运行完成,谢谢!
21
有关计算机的几个基础关键的问题..困扰很久了..麻烦专业点的大神给个通俗准确的解释,感激不尽!
4
C语言程序设计,输入身份证号码,输出出生年月日期,性别,年龄,要求用三个函数
7
请大神帮我看看我这光耦的画法对不对
3
大神们帮我看看问题:表达式必须是可修改的左值!出错的地方我用“//出错 ”标记了
4
请问有没有C语言大神指点我这个程序究竟是怎么运行?是做什么功能的?有运行截图!求解,谢谢
10
淘淘商城Spring注入报错求大神帮看看啊!!!跪求,看了好久了没解决
2
有大神有用C语言写的随机森林算法吗
6
C语言求大神帮忙看看写的二叉树删除,为什么我的这道程序执行顺序异常
2
c++ 随机整数问题,请大神指点!
10
sql文件导入navicat出错,哪位大神帮看看!解决立马c币到位
5
急!!!大神帮帮忙!!asp.netWord加水印用Spire.Doc后代码报错
1
求各位大神帮我看下为什么我下载的android studio加入百分比依赖库有错误
2
求大神帮我看看 Spring中导入ApplicationContext出错了 怎么办
0
在R中调用MHadaptive包,程序编写出错,求助大神!!!
1
C语言程序问题,谢谢各位
1
微信小程序数据渲染,求大神帮帮检查
1
求助,在学习R语言作图的过程中遇到了困难,求大神帮忙,如何实现下面两个图的编程,谢谢!
4
java并发问题,麻烦大神们看看!
2
求助大神!!!功能实现不了!!!