求个大佬改lingo程序呜呜呜 改不出来错误 救救孩子叭 !!!

model
setS:
S/1..10/:I,D,alpha;
T/1..10/:J;
car/1..3/:W,J;
tel/1..3/:E;
C(S,T):c;
Y(S,T,car):y;
F(S,T,car):f;
M(S,tel):m;
endsets
data:
alpha=40000,20000,35000,50000,20000,50000,20000,20000,20000,35000;
f=0.00,10.64,16.85,21.30,13.74,5.81,10.45,12.83,17.79,21.74,0.00,5.32,8.43,10.65,6.87,2.91,5.22,6.41,8.89,10.87,10.64,0.00,6.30,10.63,4.63,9.23,10.33,6.62,9.84,11.77,10.64,0.00,6.30,10.63,4.63,9.23,10.33,6.62,9.84,11.77,5.32,0.00,3.15,5.31,2.32,4.61,5.17,3.31,4.92,5.89,16.85,6.30,0.00,5.04,4.18,14.17,7.60,6.76,6.80,5.81,16.85,6.30,0.00,5.044.18,14.17,7.60,6.76,6.80,5.81,8.43,3.15,0.00,2.52,2.09,7.08,3.80,3.383.40,2.90,21.30,10.63,5.04,0.009.23,19.12,18.42,12.53,10.44,6.20,21.30,10.63,5.04,0.00,9.23,19.12,18.42,12.53,10.44,6.20,10.65,5.31,2.52,0.00,4.61,9.56,9.21,6.27,5.22,3.10,13.74,4.63,4.18,9.23,0.00,10.27,9.17,3.49,5.20,7.98,13.74,4.63,4.18,9.23,0.00,10.27,9.17,3.49,5.20,7.98,6.87,2.32,2.09,4.61,0.00,5.14,4.58,1.74,2.60,3.99,5.81,9.23,14.17,19.12,10.27,0.00,5.81,8.16,13.19,17.99,5.81,9.23,14.17,19.12,10.27,0.00,5.81,8.16,13.19,17.99,2.91,4.61,7.08,9.56,5.14,0.00,2.90,4.08,6.59,8.99,10.45,10.33,7.60,18.42,9.17,5.81,0.00,5.93,10.25,15.78,10.45,10.33,7.60,18.42,9.17,5.81,0.00,5.93,10.25,15.78,5.22,5.17,3.80,9.21,4.58,2.90,0.00,2.97,5.13,7.89,12.83,6.62,6.76,12.53,3.49,8.16,5.93,0.00,5.08,9.97,12.83,6.62,6.76,12.53,3.49,8.16,5.93,0.00,5.08,9.97,6.41,3.31,3.38,6.27,1.74,4.08,2.97,0.00,2.54,4.98,17.79,9.84,6.80,10.44,5.20,13.19,10.25,5.08,0.00,5.87,17.79,9.84,6.80,10.44,5.20,13.19,10.25,5.08,0.00,5.87,8.89,4.92,3.40,5.22,2.60,6.59,5.13,2.54,0.00,2.94,21.74,11.77,5.81,6.20,7.98,17.99,15.78,9.97 ,5.87 ,0.00,21.74,11.77,5.81,6.20,7.98,17.99,15.78,9.97,5.87,0.00,10.87,5.89,2.90,3.10,3.99,8.99,7.89,4.98,2.94,0.00;
e=15000,200,5000;
c=0.55,1.1,5.48,0.27,0.55,2.47,0.41,0.55,3.29,0.66,0.41,7.12,0.82,0.55,7.67,1.64,0.82,5.48,1.1,0.55,4.38,1.37,0.96,5.48,0.55,0.14,4.93,0.41,0.27,3.56;
enddata
min=(@sum(S(I):@sum(T(J):C(i,1)*Y(i,j,1)*F(i,j,1)*alpha(i)))+@sum(S(I):@sum(T(J):C(i,1)*Y(i,j,2)*F(i,j,2)*alpha(i)))+@sum(S(I):@sum(T(J):C(i,2)*Y(i,j,1)*F(i,j,1)*alpha(i)))+@sum(S(I):@sum(T(J):C(i,2)*Y(i,j,2)*F(i,j,2)*alpha(i)))+@sum(S(I):@sum(S(I):C(i,3)*Y(i,j,3)*F(i,j,3)))+@sum(S(I):@sum(car(J):E(j)*M(i,j))))*365+@sum(S(I):@max(alpha*W(i,1)+alpha*W(i,2)+alpha*W(i,3))*D(i));
@for(@sum(T(J):Y(i,j,k))+M(i,j)=1);
@for(@sum(S(I):@sum(T(j):C(i,j)*Y(i,j,1))));
@for(T(J):@sum(S(i):C(i,j)*Y(i,1)))<=7);
@for(T(J):@sum(S(i):C(i,j)*Y(i,2)))<=5);
@for(T(J):@sum(S(i):C(i,j)*Y(i,3)))<=3);
@for(@sum(S(i):@sum(car(j):W(i,j)))<=2);
@for(S:@bin(I));
@for(T:@bin(J));
@for(car:@bin(w));
@for(T(j):@sum(S(i):y(i,j))=W(i,j));
end

1个回答

我看了一下,眼花撩乱的,我现在看出来的问题就是把model改成model,这是个小问题,然后有个大问题就是lingo是不区分大小写的,所以你模型写的那些大小写要重新区分并用不同的字母代替,比如你的f可以用ff代替。记住lingo不区分大小写。本来想给你改下的,你这个错太多了,看得我眼花缭乱

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
求大佬救救孩子
//奔跑的irn#include rn#include "pch.h"rn#include rn#include rnusing namespace std;rnint main()rnrn int i;rn for (i = 1; i <= 100; i++)rn rn system("cls");rn cout << setw(i) << "i";rn Sleep(1000);rn rn rnrnrnrnrn为什么会报错啊啊啊啊rn严重性 代码 说明 项目 文件 行 禁止显示状态rn错误 C3861 “Sleep”: 找不到标识符 奔跑的i c:\users\lenovo\source\repos\奔跑的i\奔跑的i.cpp 17 rn
(小白)程序有错找不出来呜呜呜求大神
![代码如下](https://img-ask.csdn.net/upload/201610/12/1476276077_519884.png)nn错误如下!![图片说明](https://img-ask.csdn.net/upload/201610/12/1476276155_794586.png)
呜呜呜
POJ 1321 棋盘问题 这道题是经典问题八皇后的变种 因为属于简单搜索所以我们用Dfs来做。 #include&amp;amp;amp;amp;lt;bits/stdc++.h&amp;amp;amp;amp;gt; using namespace std; char s[10]; int n,k,cnt; char mp[10][10]; int a[10]; int init(){//初始化 memset(a,0,sizeof(a)); memset(...
呜呜呜...求大神帮忙!!!!
rnRHCE6的OS,裸设备配置文件99-oracle-asmdevices.rulesrn/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/sda的结果是3600c0ff0001001cd78cdaa4e02000000rnrn99-oracle-asmdevices.rules配置内容可以是以下三种rnKERNEL=="sda1", NAME="udev1", OWNER="grid", GROUP="oinstall", MODE="0660"rnrnKERNEL=="sda2", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev2", OWNER="grid", GROUP="oinstall", MODE="0660"rnrnKERNEL=="sda3", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="3600c0ff0001001cd78cdaa4e02000000", NAME="udev3", OWNER="grid", GROUP="oinstall", MODE="0660"rnrnrn疑问1:以上配置前面两种都可以用于oracle配置共享存储,第三种不行,第三种情况下sda3并不是扩展分区并且添加/etc/scsi_id.config文件加入options=--whitelisted --replace-whitespace,还是不行,不知道为什么rn疑问2:有的编辑99-oracle-asmdevices.rules ,都是写类似的:rnKERNEL=="sd*1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -s /block/$parent", RESULT=="SATA_VBOX_HARDDISK_VBd306dbe0-df3367e3_", NAME="asm-disk1", OWNER="oracle", GROUP="dba", MODE="0660"rn这些写法这是个人习惯问题,还是有啥规定?KERNEL=="sda2", NAME="udev2", OWNER="grid", GROUP="oinstall", MODE="0660"的这样的写法有啥不严谨的么?rn
小妹心中很着急。。。呜呜呜呜呜呜呜
我在做一个查询,具体内容如下:rnrnobjconn="DBQ="+server.MapPath("biaoge.mdb")+";DefaultDir=;DRIVER=Microsoft Access Driver (*.mdb);"rnset rs=server.createobject("adodb.recordset")rnsql="select * from 医疗"rnrs.open sql,objconn,1,1rnrnrn我现在有不同的查询,比如a.htm;b.htm;c.htm........,还有对应的不同的查询表,比如:医疗,卫生,健康。。。。。我能不能设置一个变量,让我能够调用*.htm查询的时候,就对应不同的表,而不再重复编程呢?因为我的表的格式都是一样的,只是内容不同而已!rnrn
小程序改错误!
#includern#includernrnint sum(int *, int);rnvoid shuru(int *);rnrnint main()rnrn int *i, n, s;rnrn printf("请输入若干整数以求平均值: ");rn shuru(i);rn n = strlen(i);rn s = sum(i, n);rn printf("结果是: %d", s);rnrnrnint sum(*i, n)rnrn if(n > 0)rn return sum(*i, n-1) + *i; rn elsern return 0;rnrnrnvoid shuru( *i )rnrnrn while( scanf("%d", i)>=0 && scanf("%d", i)!='\n')rn i++;rn
呜呜呜……,帮我!!
怎样将string或者integer转换成PChar类型,救我!!!!
哪里错了??呜呜呜
#include rn rn int toupper(int c);rn rn int main()rn rn int m,n;rn printf("请输入:\n");rn scanf("%c",&m);rn n=toupper(m);rn printf("%c\n",&n);rn rn return 0;rn rn rn rn int toupper(int c)rn rn if(c>='a'&&c<='z')rn rn return c-('a'-'A');rn rn elsern rn return c;rn rn
呜呜呜好哦个 阿富汗
和广发就哈开工建设费口水歌按附件是开关机会给
求改一个程序
我有个程序是通过遍历输出按钮元件的,代码如下rn[code=JScript]rnrn// C o p y r i g h t © f l a s h m o . c o mrn// D e v e l o p e d b y M i n T h urnrn// Tweenerrn// http://code.google.com/p/tweener/rnimport caurina.transitions.Tweener;rnrn// To make a link to an external page, write label as "Label|URL" in array valuern// EXAMPLE 1: "Flash Templates|http://www.flashmo.com/store"rn// EXAMPLE 2: "Donate|http://www.flashmo.com/donate"rnrnvar menu_label:Array = new Array("查看用户", "测试用户", "游戏康复", "关于我们",rn "Support", "Testimonials", "Company", "Contact" );rnrnvar total:Number = menu_label.length;rnvar i:Number = 0;rnvar j:Number = 0;rnvar page:Number;rnvar main_menu:MovieClip = new MovieClip();rnvar box_group:MovieClip = new MovieClip();rnstage.addChild(main_menu);rnstage.addChild(box_group);rnrnfm_button.visible = false;rnfm_box.visible = false;rnbox_group.visible = false;rnrnfor( i = 0; i < total; i++ )rnrn var btn = new flashmo_button();rn btn.name = "flashmo_btn" + i;rn btn.x = -400;rn rn var each_substring:Array = menu_label[i].split("|"); rn btn.flashmo_button_label.fm_label.text = each_substring[0];rn btn.item_url = each_substring[1];rn btn.item_no = i;rn btn.flashmo_button_thumbnail.gotoAndStop( i + 1 );rn rn main_menu.addChild(btn);rnrnrnfunction btn_over(e:MouseEvent):voidrnrn e.target.parent.over = true;rnrnrnfunction btn_out(e:MouseEvent):voidrnrn e.target.parent.over = false;rnrnrnfunction btn_click(e:MouseEvent):voidrnrn var mc = e.target.parent;rnrn if( mc.item_url != undefined )rn navigateToURL( new URLRequest( mc.item_url ), "_parent" );rn else rn change_page(mc.item_no);rnrnrn rnrnrnfunction btn_enter(e:Event):voidrnrn var mc = e.target.parent;rn rn if( mc.over == true )rn mc.nextFrame();rn elsern mc.prevFrame();rnrnrnfunction change_page(no:Number):voidrnrn page = no + 11;rn play();rnrnrnrnrnfunction credit_link(e:MouseEvent):voidrnrn navigateToURL( new URLRequest( "http://www.flashmo.com" ), "_parent" );rnrnrnrnrnfunction goto_music(e:MouseEvent):voidrnrn navigateToURL( new URLRequest( "http://www.premiumbeat.com" ), "_blank" );rnrnrnfor( i = 0; i < 13; i++ )rnrn var box = new flashmo_box();rn box.name = "flashmo_box" + i;rn box.alpha = 0;rn box.x = -500;rn box_group.addChild(box);rnrn/*rnvar default_volume:Number = 0.6; // 0.00 to 1.00rnvar bg_music:Sound = new flashmo_music();rnvar music_channel:SoundChannel = bg_music.play(0, 10000);rnvar music_volume:SoundTransform = new SoundTransform();rnrnmusic_volume.volume = default_volume;rnmusic_channel.soundTransform = music_volume;rnrnsound_control.stop();rnsound_control.addEventListener( MouseEvent.CLICK, play_pause );rnrnfunction play_pause(e:MouseEvent):voidrnrn music_volume.volume = default_volume;rn rn if( e.target.currentFrame == 1 )rn music_volume.volume = 0;rn rn music_channel.soundTransform = music_volume;rn e.target.play();rnrn*/rn[/code]rnrnrnrn这个类里面是直接有生成8个按钮,分别如上var menu_label:Array = new Array("查看用户", "测试用户", "游戏康复", "关于我们",rn "Support", "Testimonials", "Company", "Contact" );rnrn然后在rn[code=JScript]rnfunction btn_click(e:MouseEvent):voidrnrn var mc = e.target.parent;rnrn if( mc.item_url != undefined )rn navigateToURL( new URLRequest( mc.item_url ), "_parent" );rn else rn change_page(mc.item_no);rnrnrn rnrn[/code]rn打开新对话框,现在我想改成按不同按钮发送fscommand命令,因为我的按钮命名是btn.name = "flashmo_btn" + i;rn比如在click方法里,我按的是第一个按钮,也就是flashmo_btn0,那么我希望发送fscommand('bt','b0');rn如果我按的是第二个,则希望发送fscommand('bt','b1');以此类推,因为现在我的是遍历生成按钮,怎么实现这种方法呢,新手,希望在VC中调用不同按钮发送的不同命令,请高手指教
求改一段程序???
怎么把从数据库里提出来的东西加到下边那个脚本里啊rnrn求大哥们帮一下rn是一个幻灯图片的程序rnrnrnsql="select top 8 * from news where hidden=1 and ispic=1 order by id desc"rnset rs=joekoe_cms.exec(sql,1)rndo while not rs.eofrntopic=rs("topic")  ’图片主题rnpic=rs("pic") '图片地址rnid=rs("id") '图片连接地址序号rnrs.movenextrnlooprnrs.closernrnrn rn rn 对不起,图片浏览功能需脚本支持,但您的浏览器已经设置了禁止脚本运行。请您在浏览器设置中调整有关安全选项。rn rn rn rn 吃苦在前、享受在后的附属工厂周庆同志的先进事迹rn rn rnrnrn
救救孩子
[img=https://img-bbs.csdn.net/upload/201903/07/1551889423_840453.png][/img]rn0x00007FF9934EA388 处(位于 Project13.exe 中)有未经处理的异常: Microsoft C++ 异常: cv::Exception,位于内存位置 0x0000004441DCEF60 处。 出现了 rn这是什么问题急急急跪求帮忙了呜呜呜呜呜
有个错误改不过来
我写了一个有关运算符重载来操作集合交并的程序,但编译器说有个系统错误,我检查不出来在哪里。望高手指点迷津!!源程序如下。rn#include rnconst max=16;rnusing namespace std;rnenum errcode noerr,overflow;rnrnclass setrn int elems[max];rn int card;rnpublic:rn set()card=0;rn errcode addelem(int);rn void print();rn friend bool operator &(int,set);rn friend set operator *(set,set);rn friend set operator +(set,set);rn;rn rnerrcode set::addelem(int elem)rnrn for(int i=0;i0)rn cout<
一道改不出来的改错题
public class staticRunexception rn private static void f() throws RuntimeExceptionrn System.out.println("Exception from f()");rn throw new RuntimeException("from f()");rn rn rn private static void g()rn f();rn rn public static void h()throws RuntimeExceptionrn tryg();rn catch(Exception ex)rn System.err.println("IN g() e.prinStackTrace()");rn ex.printStackTrace();rn rn rn rn private static void main(String[] arg)rn staticRunexception.h();rn rnrn不知道错在哪里哦!请大家指教啊!
求大佬帮我改代码进入网站
rnrnrn rn rn rn rn Login — LION CMSrn rn rn rn rn rnrnrn rn rnrnrn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn 手机号:rn rn rn rn rn rnrn rn rn 验证码:rn rn rn rn rn rn rn rn rnrn rn 登录 rn rn rn rn rnrn rnrn
南京的大哥大姐,救救俺吧,呜呜呜...
俺的老423针P4主板前几天坏了,在珠江路转了几天也没修好。囊中羞涩,买不起新的。rn在xici发了几天帖也每人理,还有内存条也随主板同时烧了,呜呜呜...rnrn有那位好心的大哥大姐有,新旧品牌无所谓,能用就行,先谢谢了,呜呜呜...rnqq:409295237rnemail:i8210@163.com
这个错误死活都改不出来
rnrn我从PHP4中文手册上拷下来的,执行后rn$row = mysql_fetch_array($result)rnmysql_free_result($result)rn两句就是错,是不是需要设置一下呀?rn谢谢!rnrn
求大神 救救孩子吧
总的模块要求:rn第一个模块——主函数main()的功能是:根据选单的选项调用各函数,并完成相应的功能。 rn   第二个模块——Menu()的功能是:显示提示选单。 rn   第三个模块——Quit()的功能是:退出选单。 rn   第四个模块——Create()的功能是:创建新的数据记录。 rn   第五个模块——Add()的功能是:增加新的数据记录,并返回选单。 rn   第六个模块——Find()的功能是:按要求查询相关的信息,如果找到了,则显示该信息,如果未找到,则提示文件中没有该信息,并返回选单。 rn   第七个模块——Alter()[的功能是:修改某条记录的信息,如果未找到要修改的记录,则提示系统中无此记录,并返回选单。 rn   第八个模块——Delete()的功能是:删除某条记录,如果未找到要删除的记录,则提示通讯录中没有,并返回选单。 rn   第九个模块——List()的功能是:显示所有记录。 rn一、用链表或者顺序表实现以下系统,完成线性表的建立(至少包括10个结点),以及线性表中信息(结点)的插入、查找、删除、修改、输出等操作,具体的模块要求见上方的“总的模块要求”。建议用“文件”存储数据。rn3.图书管理信息系统的设计与实现rn(1)图书信息包括:书号(char num[10])、书名(char name[10])、作者(char author[10])、定价(float money)rn(2)除了总的模块要求外,还需计算查找同一作者的所有书、以及定价高于50的书的数目rn
救救孩子吧。。。急求
select rn Coach.CITYCODE as 地区,rn count(OrderRecords.ID) as 订单总数,rn sum(orderclassprice * 2) as 总金额,rn COUNT(distinct Coach.ENTERID) as 驾校,rn count(distinct CoachID) as 教练,rn sum(OrderRecords.ORDERPRICE) as 入账金额,rn sum((orderclassprice * 2) - OrderRecords.ORDERPRICE) as 优惠金额,rn count(distinct OrderRecords.STUDENTID) as 培训人数,rn count(orderclassprice)*2 as 培训学时 rn from OrderRecords,OrderClass,Coach rnwhere ORDERRECORDS.ORDERCLASSID = ORDERCLASS.ID and Coach.ID = ORDERCLASS.coachID group by Coach.CITYCODErn[img=https://img-bbs.csdn.net/upload/201903/19/1552963653_219036.png][/img]rnrnrn这样的数据库语句用linq怎么写呀
改错误
#includern#includern#includernrnchar *dic[][40]=rn"atlas","A volume of maps",rn"car","A motorized vehicle",rn"telephone","A flying machine",rn" "," "rn;rnrnint main(void)rnrn char word[80],ch;rn char **p;rn dorn puts("\nEnter word:");rn scanf("%s",word);rn p=(char**)dic;rn dorn if(!strcmp(*p,word))rn puts("Meaning:");rn puts(*(p+1));rn break;rn rn if(!strcmp(*p,word))break;rn p=p+2;rn while(*p);rn if(!*p)puts("Word not in dictionary.");rn printf("Another?(y/n):");rn scanf("%c%*c",&ch);rn while(toupper(ch)!='N');rn return 0;rnrn对于以上的程序我有几点的不明白:rn1)程序运行后并不能返回,在我输入n(而且按下任意键都是和按下y是一样的而并不局限与按n键,如何改成只能按n或y键)后程序并不返回,而是和输入y一样继续要用户输入要查的字。rn2)scanf("%c%*c",&ch);是什么意思?rn如何将这个程序改为希望的样子,既在不需要查的时候按下n就能回到程序界面
窗口时间的错误 求改
代码:rn#include rn#include rnint main( void ) rn rn SYSTEMTIME sys; rn GetLocalTime( &sys ); rn printf( "%4d/%02d/%02d %02d:%02d:%02d.%03d 星期%1d\n" rn ,sys.wYear,sys.wMonth,sys.wDay rn ,sys.wHour,sys.wMinute,sys.wSecond,sys.wMilliseconds rn ,sys.wDayOfWeek); rn return 0; rn rnrn错误:错误 1 error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用 D:\编程软件下载\C++程序设计\win窗口\窗口 时间\窗口 时间\MSVCRTD.lib(crtexew.obj) 窗口 时间rnrn错误 2 error LNK1120: 1 个无法解析的外部命令 D:\编程软件下载\C++程序设计\win窗口\窗口 时间\Debug\窗口 时间.exe 窗口 时间rnrnrnrn怎么改呢?
求大神帮忙看一下,实在改不出来。
[code=c]#include rn#include rn#include rnrnint num;rnrnstruct sturnrn int id;rn char name;rn struct stu *next;rn;rn//初始化学生链rnstruct stu* init_link()rnrn struct stu* head=(struct stu*)malloc(sizeof(struct stu));rn head->id=-1;rn head->next=NULL;rn return head;rnrn//创建一个新学生rnstruct stu* new_stu()rnrn return (struct stu*)malloc(sizeof(struct stu));rn rn//获取链表的尾部元素rnstruct stu* get_tail(struct stu* head)rnrn struct stu* cur=head;rn while(!(cur->next==NULL))rn rn cur=cur->next;rn rn return cur;rnrnrn//2、删除学生指定学生rnstruct stu* del_stu_byid(struct stu* head,int id) rnrn struct stu *cur,*tar;rn cur=head;rn if(head==NULL)rn printf("NULL!");rn while((id!=cur->id)&&(cur->next!=NULL))rn rn tar=cur;rn cur=cur->next;rn rn rn if(id==cur->id)rn rn if(cur==head)rn head=cur->next;rn elsern tar->next=cur->next;rn printf("Has been deleted!\n");rn free(cur);rn num--;rn rn elsern printf("Without this id!");rn rn return head; rnrnrn//3、修改学生信息rnstruct stu* upd_stu_byid(struct stu* head, int id)rnrn struct stu *cur,*tar;rn char name[10],*t;rn rn cur = head;rn tar = head->next;rnrn while(tar!=NULL)rn rn if( tar->id==id)rn rn printf("Please enter a modified name:");rn scanf("%s",&name);rn getchar();rn t = name;rn strcpy(tar->name,cur);rn printf("Uapdate success!"); rn free(cur);rn num--;rn rn rn elsern printf("Without this id!!\n\n"); rn rn rn return head;rnrnrn//5、根据id查询所有学生,把目标学生返回rnstruct stu* que_stu_byid(struct stu* head, int id)rnrn struct stu* cur;rn cur=head;rn int num=0;rn rn while(cur->next&&numnext;rn num++;rn rn rn if(id==num) rn return cur;rn rn elsern printf("Without this id!");rnrnrnint main()rnrn //1.添加学生rn //2.删除学生rn //3.修改学生rn //4.查询所有学生rn //5.根据id查询指定学生rn //6.退出rn int choice=0, id;rn char name;rn struct stu* head=init_link();rn struct stu* ns=NULL;rn struct stu* tail=NULL;rn struct stu* cur=NULL;rn struct stu* tar=NULL;rn printf("*****welcome to stu_manage_system*****\n");rn rn while(1)rn rn printf("1.insert stu info\n");rn printf("2.delete stu info\n");rn printf("3.update stu info\n");rn printf("4.query all stu info\n");rn printf("5.query stu info by id\n");rn printf("6.exit\n");rn printf("make your choice:");rn scanf("%d",&choice);rn if(choice==1)rn rn printf("input stu_id, plz:");rn scanf("%d", &id);rn printf("input stu_name, plz:");rn scanf("%d", &name);rn ns=new_stu();rn ns->id=id;rn ns->name=name;rn ns->next=NULL;rn tail=get_tail(head);rn tail->next=ns;rn rn if(choice==2)rn rn printf("Please enter the number you want to delete:");rn scanf("%d",&id);rn head=del_stu_byid(head,id); rn rn if(choice==3)rn rn printf("Please enter the number you want to update:\n");rn scanf("%d",&id);rn getchar();rn upd_stu_byid(head,id);rn rn if(choice==4)rn rn cur=head;rn while(!(cur->next==NULL))rn rn cur=cur->next;rn printf("stu_id=%d\n",cur->id);rn printf("stu_name=%d\n",cur->name);rn printf("++++++\n");rn rn rn if(choice==5)rn rn printf("Please enter the number you want to query:");rn scanf("%d",&id);rn getchar();rn cur=que_stu_byid(head,id); rn printf("%d,%s",cur->id,cur->name);rn rn if(choice==6)rn rn system("pause");rn rnrn rn return 0; rn[/code]
帮忙C# 程序改错误。
using System;rnpublic class addrsOprrnrn unsafe public static int Main(string[] args)rn rn // addrsOpr.csrn // A C# program demonstrating how to usern // the Binary AND operator & to returnrn // the address of an unsafe valuern // PROGRAM DOES NOT COMPILE - erad last comment!!!rn // Copyright (c) Chris H. Pappas and William H. Murray, 2001rn //rnrn Console.WriteLine("& used on true AND true = 0", true & true);rn Console.WriteLine("& used on true AND false = 0", true & false);rnrn int iValue = 4;rnrn // the following "fixed" block IS crrect - hower,rn // the program will NOT compile - WHY?rn fixed(int *pi = &iValue)rn rn string hexAddress = int.Format((int)pi, "x");rn Console.WriteLine("& returning address of iValue: 0", hexAddress);rnrn // or the simpler version, not using teh string variablern Console.WriteLine("& returning address of iValue: 0", int.Format((int)pi, "x"));rn rn rn // to get addrsOpr.cs to compile and executern // your MUST remember - ANY method using unsafe pointersrn // must include the "unsafe" keyword in the method prototypern // when you change Main()'s prototype to:rn // unsafe public static int Main(string[] args)rn // the program will compile and execute!rnrn return 0;rn rn
帮忙C# 程序改错误
帮忙C# 程序改错误rnusing System; rn public class addrsOpr rn rn unsafe public static int Main(string[] args) rn rn // addrsOpr.cs rn // A C# program demonstrating how to use rn // the Binary AND operator & to return rn // the address of an unsafe value rn // PROGRAM DOES NOT COMPILE - erad last comment!!! rn // Copyright (c) Chris H. Pappas and William H. Murray, 2001 rn // rn rn Console.WriteLine("& used on true AND true = 0", true & true); rn Console.WriteLine("& used on true AND false = 0", true & false); rn rn int iValue = 4; rn rn // the following "fixed" block IS crrect - hower, rn // the program will NOT compile - WHY? rn fixed(int *pi = &iValue) rn rn string hexAddress = int.Format((int)pi, "x"); rn Console.WriteLine("& returning address of iValue: 0", hexAddress); rn rn // or the simpler version, not using teh string variable rn Console.WriteLine("& returning address of iValue: 0", int.Format((int)pi, "x")); rn rn rn // to get addrsOpr.cs to compile and execute rn // your MUST remember - ANY method using unsafe pointers rn // must include the "unsafe" keyword in the method prototype rn // when you change Main()'s prototype to: rn // unsafe public static int Main(string[] args) rn // the program will compile and execute! rn rn return 0; rn rn
各位老大帮帮忙 呜呜呜..
我女朋友和我闹别扭 不理我了 连qq都找不到她 rn所以我现在急需一个可以查出她是否在线的方法 rn软件 或是什么的都行 谢谢 rn呜呜呜....... rn rn
求改
代码 :rnrn FILE *fp = fopen("a.txt","a");rnrn char name[10],password[7],pname[10],a[10];rn printf("输入\n");rn gets(name);rn printf("\n输入:\n");rn gets(password);rn fprintf(fp,"%10s %10s",name,password);rn rn fflush(stdin);rn printf("\n成功!\n读出第二个字符串\n");rn rewind(fp);rn fscanf(fp,"%*s",password);rn fscanf(fp,"%s",password);rn puts(password);rn printf("\n输入替换password的字符串:\n");rn gets(a);rn strcpy(password,a);rn fprintf(fp,"%10s",password);rn fclose(fp);rnrn return 0;rna复制给了passwordrn为什么 文件中a会在password后面呢 ??而不是替换password的 内容呢 ??应该怎么改 才能在文件中让a替换password的位置??rn
呜呜呜。。。。。难道是不治之症?
我的机器原来什么问题也没有,昨天想装WIN2K,就把它重新分区了,可是当我用SPFIDISK进入DOS后,出现了提示:Prompt:Do you wish to use FAT32 file system?当我按了Y后,出现的画面让我惊呆了:rn整个屏幕上在DOS的兰底色上出现了4条不规则的红绿条纹,上边有字显示:rnrnrn我从来没遇到过这种情况啊。然后我不知按了哪个键,出现了一个窗口提示:rnINT13H failure. it is possible hard error rnrn然后我就断了电将硬盘拆下来,重起机器,居然情况如上所述。rnrn也就是说是不是硬盘坏了,另外我在尝试作低格时系统提示没能找到硬盘。rnrnrn可是我的硬盘明明是好的呀?rnrn求求大家帮帮我吧!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!rn
改程序
[b][color=#FF0000]目前输出效果:rnA 60 现汇款rnB 20 现汇款rnC 45 现汇款+承兑款rnD 40 现汇款rnE 140 现汇款+承兑款rnrn改成下面效果rn======================rnA 60 现汇款rnB 20 现汇款rnC 20 现汇款rnC 25 承兑款rnD 40 现汇款rnE 100 现汇款rnE 40 承兑款rnrn不用问为什么要实现这个效果,我也不知道怎么会有这种业务 没办法[/color][/b]rnrn[code=Java]import java.util.ArrayList;rnimport java.util.List;rnrnrnrnpublic class EipCustomer rn private int uid;rn private String city;rn private String name;rn public String getName() rn return name;rn rn public void setName(String name) rn this.name = name;rn rn public int getUid() rn return uid;rn rn public void setUid(int uid) rn this.uid = uid;rn rn public String getCity() rn return city;rn rn public void setCity(String city) rn this.city = city;rn rn rn rnrn public static void main(String str[]) rn List alist1 = new ArrayList();rnrn EipCustomer ep = new EipCustomer();rn ep.setCity("现汇款");rn ep.setUid(100);rn alist1.add(ep);rnrn EipCustomer ep2 = new EipCustomer();rn ep2.setCity("承兑款");rn ep2.setUid(25);rn alist1.add(ep2);rnrn EipCustomer ep3 = new EipCustomer();rn ep3.setCity("现汇款");rn ep3.setUid(40);rn alist1.add(ep3);rnrn EipCustomer ep113 = new EipCustomer();rn ep113.setCity("承兑款");rn ep113.setUid(40);rn alist1.add(ep113);rn rn EipCustomer ep13 = new EipCustomer();rn ep13.setCity("现汇款");rn ep13.setUid(140);rn alist1.add(ep13);rn rn rn rn List alist12 = new ArrayList();rn EipCustomer ep4 = new EipCustomer();rn ep4.setUid(60);rn ep4.setName("A");rn alist12.add(ep4);rnrn EipCustomer ep5 = new EipCustomer();rn ep5.setUid(20);rn ep5.setName("B");rn alist12.add(ep5);rnrn EipCustomer ep6 = new EipCustomer();rn ep6.setUid(45);rn ep6.setName("C");rn alist12.add(ep6);rnrn EipCustomer ep7 = new EipCustomer();rn ep7.setUid(40);rn ep7.setName("D");rn alist12.add(ep7);rn rn EipCustomer ep17 = new EipCustomer();rn ep17.setUid(140);rn ep17.setName("E");rn alist12.add(ep17);rnrn List alist13 = new ArrayList();rn rn int sum = 0;rn int index = 0;rn String city = null;rn //循环第一个集合rn for(int j = 0;j 0)rn ec2.setCity(city == null ? ec1.getCity() : ec1.getCity()+"+"+city);rn rn// ec2.setCity(ec1.getCity());rn alist13.add(ec2);rn sum = count;rn city = null;rn else if( count == 0)rn index = i + 1;rn ec2.setCity(city == null ? ec1.getCity() : city+"+"+ec1.getCity());rn alist13.add(ec2);rn sum = count;rn city = null;rn break;rn elsern index = i;rn city = ec1.getCity();rn break;rn rn rn rn rn for (int j = 0; j < alist13.size(); j++) rn ep = (EipCustomer) alist13.get(j);rn System.out.println(ep.getName()+ " " +ep.getUid() + " " + ep.getCity());rn rn rn[/code]
求高手改一程序
题目:实现下面类的派生和每个类内部的成员变量和成员方法,对派生类和基类的同名方法实现重载:rnPoint类:成员变量 int x , yrn 成员方法 Point ( ), Point ( x, y ), setPoint ( x, y ), getX ( ), getY ( )rnPoint类直接派生Line类:rn成员变量 Point p1 , p2rn成员方法 Line ( x, y ), setPoint ( p1, p2 ), distance( p1,p2 )rnLine类直接派生Trapezoid类(梯形):rn成员变量 Line l1 , l2, high,p1, p2, p3, p4rn成员方法 getArea ( l1,l2, h ), getCircumference ( p1, p2, p3, p4 )rnLine类直接派生Parallelogram类(平行四边形):rn成员变量 Line l1 , l2rn成员方法 getArea ( l1,l2 ), getCircumference ( l1, l2 )rnLine类直接派生Rectangle类(矩形):rn成员变量 Line l1 , l2rn成员方法 getArea ( l1,l2 ), getCircumference ( l1, l2 )rnRectangle类直接派生Square类(正方形):rn成员变量 Line Sidern成员方法 getArea ( side ), getCircumference ( side )。rn编写一个程序,分别输入这些梯形、平行四边形、矩形和正方形类的实例对象的参数值,并逐个输出每个图形对象的左上角坐标、一条上水平边长、图形面积和周长。rnrnrnrnrnusing System;rnusing System.Collections.Generic;rnusing System.Linq;rnusing System.Text;rnrnpublic class Pointrnrn int x;rn int y;rn public Point() rn public Point(int a, int b)rn rn x = a;rn y = b;rn rn public void setPoint(int a, int b)rn rn x = a;rn y = b;rn rn public int getX() return x; rn public int getY() return y; rnrnrnpublic class Line : Pointrnrn Point p1, p2;rn public Line() rn public Line(Point x, Point y)rn rn p1 = x;rn p2 = y;rn rn rn public void setPoint(Point p1, Point p2)rn rn this.p1 = p1;rn this.p2 = p2;rn rn rnrn public int distance(Point p1, Point p2)rn rn int d;rn d = p2.getX() - p1.getX();rn return d;rn rn public int distance1(Point p1, Point p2)rn rn int d;rn d = p2.getY() - p1.getY();rn return d;rn rnrnrnrnpublic class Trapezoid : Linernrn Line l1, l2, high;Point p1, p2, p3, p4;rnrn public double getArea (Line l1,Line l2, Line h)rn rn double a;rn a = 1 / 2 * ((l1.distance(p1, p2) + l2.distance(p1, p2)) * h.distance1(p2, p3));rn return a;rn rn public int getCircumference(Point p1, Point p2, Point p3, Point p4)rn rn int c;rn c = (p2.getX() - p1.getX()) + (p2.getY() - p3.getY()) + (p3.getX() - p4.getX()) + (p1.getY() + p4.getY());rnrn return c;rn rnrnpublic class Parallelogram : Linernrnrn Line l1, l2;rn Point p1, p2, p3, p4;rn public int getArea(Line l1, Line l2)rn rn int a;rn a = l1.distance(p1, p2) * l2.distance1(p2, p3);rn return a;rn rn public int getCircumference(Line l1, Line l2)rn rn int c;rn c = 2 * l1.distance(p1, p2) + 2 * l2.distance1(p2, p3);rn return c;rn rnrnpublic class Rectangle : Linernrnrn Line l1, l2;rn public int getArea(Line l1, Line l2)rn rn int a;rn a = (l2.getX() - l2.getX()) * l1.getY();rn return a;rn rn public int getCircumference(Line l1, Line l2)rn rn int c;rn c = 2*(l2.getX() - l2.getX()) +2*l1.getY();rn return c;rn rnrnpublic class Square : Linernrn Line Side;rn public int getArea(Line Side)rn rn int a;rn a = 4 * Side.getX();rn return a;rn rn public int getCircumference(Line Side)rn rn int c;rn c = Side.getX() * Side.getX();rn return c;rn rn public static void Main(string[] args)rn rn Console.WriteLine("Trapezoid");rn Trapezoid A = new Trapezoid();rn Point p1 = new Point(2, 2);rn Console.WriteLine("p1(0,1)", p1.getX(), p1.getY());rn Point p2 = new Point(3, 2);rn Console.WriteLine("p2(0,1)", p2.getX(), p2.getY());rn Point p3 = new Point(1, 1);rn Console.WriteLine("p3(0,1)", p3.getX(), p3.getY());rn Point p4 = new Point(4, 1);rn Console.WriteLine("p4(0,1)", p4.getX(), p4.getY());rn Console.WriteLine("左上角(0,1)", p1.getX(), p1.getY());rn Line l1 = new Line(p1,p2);rn Line l2 = new Line(p3,p4);rn Line high = new Line(p1,p3);rn int n;rn n = l1.distance(p1, p2);rn Console.WriteLine("上水平边长(0", n);rn double m;rn m = A.getCircumference(p1, p2, p3, p4);rn Console.WriteLine("Circumference is 0", m);rn rn rn Console.WriteLine("------------------------------------------------");rn Console.WriteLine("Parallelogram");rn Parallelogram B = new Parallelogram();rn Console.WriteLine("Trapezoid");rn rn Point p11 = new Point(2, 2);rn Console.WriteLine("p1(0,1)", p11.getX(), p11.getY());rn Point p21 = new Point(4, 2);rn Console.WriteLine("p2(0,1)", p21.getX(), p21.getY());rn Point p31 = new Point(3, 1);rn Console.WriteLine("p3(0,1)", p31.getX(), p31.getY());rn Point p41 = new Point(1, 1);rn Console.WriteLine("p4(0,1)", p41.getX(), p41.getY());rn Console.WriteLine("左上角(0,1)", p11.getX(), p11.getY());rnrn Line l3 = new Line(p11, p21);rn int n1;rnrn n1 = l1.distance(p11, p21);rn Console.WriteLine("上水平边长(0", n1);rnrn rn Line l4=new Line (p2,p3);rn int a;rn a = B.getArea(l3, l4);rn int b;rn b = B.getCircumference(l3, l4);rn Console.WriteLine("Circumference is 0", b);rn Console.WriteLine("Area is 0", a);rn Console.WriteLine("-------------------------------------------");rnrnrn rnrn
求大神帮忙改程序
import java.util.*;rnpublic class Account rn private String number;rn private int balance=10000;rn private static int m=0;rn private static String p;rn private static String q;rn private static String s;rn private static String t;rn void setItem(String num, int bal)rn number=num;rn balance=bal;rn rn double CheckBalance ()rn return balance;rn rn void deposit(int money1)rn balance=balance+money1;rn rn void Withdrawing(int money2)rn balance=balance-money2;rn rn rn public static void main(String[] args) rn Account A=new Account(); rn Scanner reader=new Scanner(System.in);rn System.out.println("请输入账号:");rn A.number=reader.next();rn if(A.number.equals("10010"))rn rn System.out.println("查询余额请按1;取款请按2;存款请按3");rn m=reader.nextInt();rn if(m<0||m>3)rn System.out.println("操作错误!");rn else if(m==1)rn System.out.println("您当前余额为:"+A.CheckBalance());rn rn else if(m==2)rn rn System.out.println("请输入要取出的金额:");rn int money2=reader.nextInt();rn if(money2>A.balance)rn System.out.println("余额不足!");rn elsern A.Withdrawing(money2);rn System.out.println("取款后余额为:"+A.CheckBalance());rn System.out.println("要继续 取款吗(Y/N)?");rn p=reader.next();rn if(p.equals("Y/y"))rn System.out.println("请输入要取出的金额:");rn int money3=reader.nextInt();rn if(money3>A.balance)rn System.out.println("余额不足!");rn elsern A.Withdrawing(money3);rn System.out.println("取款后余额为:"+A.CheckBalance());rn System.out.println("要继续 取款吗(Y/N)?");rn q=reader.next();rn if(q.equals("Y/y"))rn System.out.println("请输入要取出的金额:");rn int money4=reader.nextInt();rn if(money4>A.balance)rn System.out.println("余额不足!");rn elsern A.Withdrawing(money4);rn System.out.println("取款后余额为:"+A.CheckBalance());rn rn rn elsern System.exit(0);rn rn rn elsern System.exit(0);rn rn rn else if(m==3)rn System.out.println("请输入要存入的金额:");rn int money1=reader.nextInt();rn A.deposit(money1);rn System.out.println("存款后余额为:"+A.CheckBalance());rn System.out.println("要继续 存款吗(Y/N)?");rn s=reader.next();rn if(s.equals("Y/y"))rn System.out.println("请输入要存入的金额:");rn int money5=reader.nextInt();rn A.deposit(money5);rn System.out.println("存款后余额为:"+A.CheckBalance());rn System.out.println("要继续 存款吗(Y/N)?");rn t=reader.next();rn if(t.equals("Y/y"))rn System.out.println("请输入要存入的金额:");rn int money6=reader.nextInt();rn A.deposit(money6);rn System.out.println("存款后余额为:"+A.CheckBalance());rn rn elsern System.exit(0);rn rn elsern System.exit(0);rn rn rn elsern System.out.println("账号输入错误!");rn rn
求仙人改写个程序
俺初学C++,教材上有个题目是这样的,不知道该怎么写~~~所以上来请教各路大仙帮帮忙,先谢谢了。rn题目如下:rnrnrnrn1.改写下面程序,要求在程序中的日期类的基础上,实现一个可进行加天数操作获得另一个日期,以及进行日期减日期操作获得相隔天数的日期类,并进行应用程序设计: 创建2005.8.21和2008.8.8两个日期,并计算中间相隔的天数,前者加上300天会是什么日子。rnrnrnrn2.在1的Date类的基础上,继承一个WDate类,它包含了星期几信息,因而显示日期的成员要作修改,应同时显示星期几。另外还要增加获得星期几的成员。进而按要求进行应用程序设计: 创建2005.8.21和2008.8.8两个日期,分别显示这两个日期。rnrnrn[code=C/C++]#includern#includernusing namespace std;rnrnclass Datern int year, month, day;rn void init();rnpublic:rn Date(const string& s);rn Date(int y=2000, int m=1, int d=1);rn bool isLeapYear()const;rn friend ostream& operator<<(ostream& o, const Date& d);rn;rnvoid Date::init()rn if(year>5000 || year<1 || month<1 || month>12 || day<1 || day>31)rn exit(1); // 停机rnrnDate::Date(const string& s)rn year = atoi(s.substr(0,4).c_str());rn month = atoi(s.substr(5,2).c_str());rn day = atoi(s.substr(8,2).c_str());rn init();rnrnDate::Date(int y, int m, int d)rn year=y, month=m, day=d;rn init();rnrnbool Date::isLeapYear()constrn return (year % 4==0 && year % 100 )|| year % 400==0;rnrnostream& operator<<(ostream& o, const Date& d)rn o<
求高手改程序,谢谢
#define NULL 0rn#include rn#include rn struct nodernrn int coej;rn int exp;rn struct node *next;rn;rnvoid main()rn rn int coej,exp;rn char cont;rn struct node *list,*p,*p2,*h;rnlist=p=(struct node *) malloc(sizeof(struct node));rn scanf("%d",&coej);rn printf("继续?");rn fflush(stdin);rn cont=getchar();rn while (cont=='y')rn rn p2=p;rn p=(struct node *) malloc(sizeof(struct node));rn scanf("%d",&exp);rn p2->next=p;rn printf("继续?");rn fflush(stdin);rn cont=getchar();rn rn p->next=NULL;rnrnvoid printf(struct node *h);rnrn struct node *p;rn p=h; while (p)rn rn if (p->coej>0)rn printf("+");rn elsern printf("-");rn rn printf("%dx^%d",p->coej,p->exp);rn p=p->next;rnrnmain()rnrn struct node *list;rn list=creat();rn print(list);rnrn
万恶的课程设计。。呜呜。。求大神改一下学生信息管理系统
学期快结束了,学校要求计算机专业的要做个课程设计;本以为做个课本上有的学生信息管理系统会节省下时间。rn尼玛做到数据库那块发现书上的例题都是问题了,忒坑了;老师忙于其他同学的问题也没时间解决。rn大家都是从学生时代过来的帮忙解决下吧[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/5.gif][/img]rn代码在这里,删除数据时老是出错;请大神指点rn全部代码在这里http://yun.baidu.com/share/link?shareid=1137622446&uk=489028261rnrnrnusing System;rnusing System.Collections.Generic;rnusing System.ComponentModel;rnusing System.Data;rnusing System.Drawing;rnusing System.Linq;rnusing System.Text;rnusing System.Windows.Forms;rnusing System.Data.SqlClient;rnnamespace MySchoolrnrn public partial class StudentFrm : Formrn rn int current = 1;rn string connString = @"Data Source=.\SQLEXPRESS;Initial Catalog=MySchool;Integrated Security=True";rn public StudentFrm()rn rn InitializeComponent();rn current = 1;rn ShowCurrentStudent();rn rn private void ShowCurrentStudent()rn rn string sql = string.Format("SELECT * FROM StudentMsg WHERE StudentNo='0'", current);rn using (SqlConnection conn = new SqlConnection(connString))rn rn conn.Open();rn SqlCommand comm = new SqlCommand(sql, conn);rn SqlDataReader reader = comm.ExecuteReader();rn if (reader.Read())rn rn textBox4.Text = Convert.ToString(reader.GetInt32(0));rn textBox1.Text = reader.GetString(1);rn string sex = reader.GetString(2);rn if (sex == "男")rn radioButton1.Checked = true;rn elsern radioButton2.Checked = true;rn dateTimePicker1.Value = reader.GetDateTime(3);rn textBox2.Text = reader.GetString(4);rn textBox3.Text = reader.GetString(5);rn string[] hobbies = new string[6];rn hobbies = reader.GetString(6).Split('、');rn checkBox1.Checked = false;rn checkBox2.Checked = false;rn checkBox3.Checked = false;rn checkBox4.Checked = false;rn checkBox5.Checked = false;rn checkBox6.Checked = false;rn foreach (string s in hobbies)rn rn switch (s)rn rn case "阅读": checkBox1.Checked = true; break;rn case "体育": checkBox2.Checked = true; break;rn case "音乐": checkBox3.Checked = true; break;rn case "上网": checkBox4.Checked = true; break;rn case "旅游": checkBox5.Checked = true; break;rn default: checkBox6.Checked = true; break;rn rn rn rn elsern MessageBox.Show("前面或后面已无数据了", "没有数据", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);rn reader.Close();rn rn rn private void button1_Click(object sender, EventArgs e)rn rn current--;rn ShowCurrentStudent();rn rnrn private void button2_Click(object sender, EventArgs e)rn rn current++;rn ShowCurrentStudent();rn rnrn private void button3_Click(object sender, EventArgs e)rn rn string sex = "";rn if (radioButton1.Checked)rn sex = "男";rn elsern sex = "女";rn string hobby = "";rn if (checkBox1.Checked) hobby += checkBox1.Text;rn if (checkBox2.Checked) hobby += "、" + checkBox2.Text;rn if (checkBox3.Checked) hobby += "、" + checkBox3.Text;rn if (checkBox4.Checked) hobby += "、" + checkBox4.Text;rn if (checkBox5.Checked) hobby += "、" + checkBox5.Text;rn if (checkBox6.Checked) hobby += "、" + checkBox6.Text;rn string sql = string.Format("UPDATE StudentMsg SET StudentNo='0', StudentName='1',Sex='2',Birthday='3',Department='4',Speciality='5',Hobby='6'WHERE StudentNo='7'", textBox4.Text, textBox1.Text, sex, dateTimePicker1.Value, textBox2.Text, textBox3.Text, hobby, current);rn string connString = @"Data Source=.\SQLEXPRESS;Initial Catalog=EX10;Integrated Security=true";rn using (SqlConnection conn = new SqlConnection(connString))rn rn conn.Open();rn SqlCommand comm = new SqlCommand(sql, conn);rn int n = comm.ExecuteNonQuery();rn if (n > 0)rn MessageBox.Show("数据更新操作失败,请检查数据格式!", "操作数据库出错!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);rn rn rnrn private void button4_Click(object sender, EventArgs e)rn rn // int t=Convert .ToInt32( textBox4.Text);rn string sql = string.Format("delete from StudentMsg WHERE StudentNo=0",current );rn // string sql = string.Format("DELETE FROM StudentMsg");rn // string sql = "delete from StudentMsg WHERE StudentNo=" + t.ToString() + "'";rn string connString = @"Data Source =.\SQLEXPRESS;Initial Catalog=MySchool;Integrated Security=True";rn tryrn rn SqlConnection conn = new SqlConnection(connString);rn rnrn // SqlParameter pa = new SqlParameter("@id", SqlDbType.Int);rn // pa.Value = t;rn conn.Open();rn SqlCommand comm = new SqlCommand(sql,conn);rn // comm.Parameters.Add(pa);rn // comm.CommandText = "delete from StudentMsg where StudentNo=" + Convert.ToInt32(textBox4.Text);rn // comm.Connection = conn;rn int n = comm.ExecuteNonQuery();rn // if (n == 1)rn // rn // MessageBox.Show("删除成功!", "注意", MessageBoxButtons.OK);rn // rn if (n <= 0)rn MessageBox.Show("删除失败,请与管理员联系!", "操作数据库出错!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);rn elsern rn current--;rn ShowCurrentStudent();rn rn rn catch (Exception ex)rn rn MessageBox.Show(ex.Message,"",MessageBoxButtons.OK );rn rn rn rn
java.lang.NullPointerException救救孩子吧
HTTP Status 500 - java.lang.NullPointerExceptionrnrnrntype Exception reportrnrnmessage java.lang.NullPointerExceptionrnrndescription The server encountered an internal error that prevented it from fulfilling this request.rnrnexception rnorg.apache.jasper.JasperException: java.lang.NullPointerExceptionrn org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:561)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:731)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn com.filter.UTFFilter.doFilter(UTFFilter.java:40)rnrnrnrnroot cause rnjava.lang.NullPointerExceptionrn org.apache.jsp.inbox_jsp._jspService(inbox_jsp.java:96)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:731)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:731)rn org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)rn com.filter.UTFFilter.doFilter(UTFFilter.java:40)rnrnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/7.0.82 logs.rnrn不是Tomcat lib里jar包占用的问题,一直找不到解决方法,求救各位大神rn
救救孩子呀
select rn Coach.CITYCODE as 地区,rn count(OrderRecords.ID) as 订单总数,rn sum(orderclassprice * 2) as 总金额,rn COUNT(distinct Coach.ENTERID) as 驾校,rn count(distinct CoachID) as 教练,rn sum(OrderRecords.ORDERPRICE) as 入账金额,rn sum((orderclassprice * 2) - OrderRecords.ORDERPRICE) as 优惠金额,rn count(distinct OrderRecords.STUDENTID) as 培训人数,rn count(orderclassprice)*2 as 培训学时 rn from OrderRecords,OrderClass,Coach rnwhere ORDERRECORDS.ORDERCLASSID = ORDERCLASS.ID and Coach.ID = ORDERCLASS.coachID group by Coach.CITYCODErn[img=https://img-bbs.csdn.net/upload/201903/18/1552912876_734744.png][/img]rnrn新人正在学习,请问这样的数据库语句用linq该在怎么写呀。。。
救救孩子1
一直用grid列表,今天需要使用一个动态生成的、无翻页的table。 通过table对象,可以轻松操作某行某列。 //第二行第一列 document.getElementById("buildTable").rows[1].cells[0] 但是这样取出来的是 网上查了下说a标签内文字用innerHTML,我试了都去不出来… 后来我就写了个input,心想input取值好取吧!结果人生陷入...
救救孩子吧!
视频直播 张三:6666 发送 if(month &amp;amp;lt; 10) { month = &amp;quot;0 &amp;quot; + month; } if(date &amp;amp;lt; 10) { date = &amp;quot;0 &amp;quot; + date; } if(hours &amp;amp;lt; 10) { hours = &amp;quot;0 &amp;quot; + hours; } if(minute
救救孩子吧
Invalid synatx为什么一直出现这个[face]monkey:0.gif[/face][face]monkey:0.gif[/face][face]monkey:0.gif[/face]n我都改了好几遍,到底是啥问题・_・?有大佬知道嘛[img=https://img-bbs.csdn.net/upload/201906/30/1561906290_176912.jpg][/img]
求改图片啊,改个字
[img=http://img.my.csdn.net/uploads/201303/25/1364173781_7696.jpg][/img]rnrn图片大小 120*40rnrn把图片的文字改成:站内付款
错误,如何改!
[code=HTML]rnrnrnrn rn rn<%rnid=request.QueryString("id")rnset rs=server.CreateObject("adodb.recordset")rnsql="select * from fproduct where id="&idrnrs.open sql,conn,1,1rn%>rn<%rnsession(a) = rs("id") ------------------------------------->问题点rnresponse.Write session(a)rnset res=server.CreateObject("adodb.recordset")rnsqld="select top 15 * from fproduct order by id desc"rnres.open sqld,conn,1,1rnif request.QueryString("action") = "save" thenrnset rsx=server.CreateObject("adodb.recordset")rnrsx.open "select * from nepingjia",conn,1,3rnrsx.addnewrnrsx("uid")=session(a) ------------------------------------->问题点rnrsx("nename")=htmlencode2(Trim(Request.Form("nename"))) rnrsx("netitle")=htmlencode2(Trim(Request.Form("netitle"))) rnrsx("pingjia")=htmlencode2(Trim(Request.Form("pingjia"))) rnrsx("necontent")=htmlencode2(Trim(Request.Form("necontent"))) rnrsx("adip")=Request.ServerVariables("REMOTE_ADDR")rnrsx("dates")=date()rnrsx.updaternresponse.Write " "rnresponse.Endrnend ifrnrnif rs.bof and rs.eof thenrnresponse.write " " & Chr(13)rnresponse.End()rnelsernSet rsnews=Server.CreateObject("ADODB.RecordSet") rnsql="update fproduct set viewnum=viewnum+1 where id="&cstr(request("id"))rnconn.execute sqlrnrsnews.closernset rsnews=nothingrn%>rn[/code]
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法