我写的哪里错了,求助

#include
#include
void main(void)
{
char str1[30]={0};
char str2[30]={0};
char str3[30]={0};
printf("Please input the first number:");
gets(str1);
printf("Please input the second number:");
gets(str3);
add(str1 str2 str3);
}
void add((char str3[] char str5[] char str6[])
{
char str7[30];
void format(char str3[] char str5[])
str7[20]={'.'};
str6[29]={(str3[m]-'0')+(str5[m]-'0')%10};
for(m=28;m>-1;m--)
{
str6[m]={(str3[m]-'0')+(str5[m]-'0')%10+(str3[m+1]-'0')+(str5[m+1]-'0')/10};
}
for(b=0;b str7[b]=str6[b];
for(c=21;c str7[c]=str6[c];
puts(str7);
return 0;
}
void format(char str[] char str4[])
{
int point=0,i=0,j=0,sign_point=0;
while(str[i]!=0)
{
if(str[i]'9')
{
if(str[i]!='.')
{
printf("data error");
return(-1);
}
else
{
point++;
sign_point=i;
}
}
if(point>1)
{
printf("data error");
return(-1);
}
i++;
}
if(point==1)
{
int k=0,a=0,n=0;
for(j=sign_point;str[j]=0;j++)
k=j;
for(j=sign_point;str[j]=0;j++)
{

str4[20+a]=str[j];
a++;
}
for(j=sign_point;j=0;j--)
str4[20-n]=str[j];

}
return str4[];

}
void miu(char str9[] char str10[] char str11[])
{
char str12[30];
void format(char str9[] char str12[])
str12[20]={'0'};
int n2=0;
n2=str9[]-'0')*10-(str10[m]-'0')%10
for(m=28;m>-1;m--)
{
str11[m]=((str9[m]-'0'+n2-1)*10-str10[m]-'0')%10;
n2=str9[m]-'0')*10-(str10[m]-'0')/10;
}
for(b=0;b<20;b++)
for(c=21;c<30;b++)
str12[c]=str11[c];
puts(str12);
return 0;
}
}

c

5个回答

你的需求是什么,题目

qq_33369307
qq_33369307 实现两个数的加减运算
接近 4 年之前 回复
qq_33369307
qq_33369307 需求是实现两个数的加减运算
接近 4 年之前 回复
 add(str1,str2,str3);//缺少逗号
}
void add((char str3[, char str5[],char str6[])//缺少逗号
qq_33369307
qq_33369307 我这语法有错吗?
接近 4 年之前 回复

add(str1,str2,str3);//缺少逗号
}
void add((char str3[, char str5[],char str6[])//缺少逗号

add(str1,str2,str3);//缺少逗号
}
void add((char str3[, char str5[],char str6[])//缺少逗号

调用format()语法有问题

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
我这个哪里写错了?
"rnrn错误信息rnrnCS1502: 与“System.Web.HttpServerUtility.UrlEncode(string)”最匹配的重载方法具有一些无效参数
我这么写哪里错了???
我一点详细信息就提示Info1为空或不是对象rnrn详细信息rn rn......rn
我写的堆栈哪里错了?
我自己写了一个堆栈,rntype TStack=classrnprivaternsize:Integer;rncontainer:array [1..20] of Integer;rnpublicrnconstructor Create();rnfunction Push(aNode:Integer):boolean;rnfunction Pop(out aNode:Integer):boolean;rnend;rnrnrnimplementationrnrnconstructor TStack.Create();rnbeginrnsize:=0;rnend;rnrnfunction TStack.Push(aNode:Integer):boolean;rnbeginrn if(size>=20) thenrn beginrn Exception.Create('Stack is full!');rn result:=false;rn endrn elsern beginrn container[size]:=aNode;rn Inc(size);rn result:=True;rn end;rnrnend;rnrnfunction TStack.Pop(out aNode:Integer):boolean;rnbeginrnif (size<=0) thenrn beginrn Exception.Create('Stack is empty');rn result:=False;rn endrn elsern beginrn aNode:=container[size];rn dec(size);rn result:=True;rn end; rnrnend;rn测试代码如下,运行后点击pop,push就会出现内存冲突,请问怎么回事?rnvarrn Form1: TForm1;rn S1:TStack;rnprocedure TForm1.Button1Click(Sender: TObject);rnbeginrnS1.Push(StrToInt(Edit1.Text));rnend;rnrnprocedure TForm1.Button2Click(Sender: TObject);rnvarrnmsg:String;rnnode:Integer;rnbeginrn S1.Pop(node);rn msg:=IntTostr(node);rn Showmessage(msg);rnend;
我的过滤器哪里写错了?
[code=XML]rnrn SetCharacterEncodingFilterrn rn tools.SetCharacterEncodingFilterrn rn rn encodingrn UTF-8rn rn rnrn rn SetCharacterEncodingFilterrn *.jsprn rnrn rn SetCharacterEncodingFilterrn *.dorn rnrn[/code]rnrn[code=Java]rnpublic class SetCharacterEncodingFilter implements Filter rnrn protected FilterConfig filterConfig;rn protected String encodingName;rn protected boolean enable;rnrn public SetCharacterEncodingFilter() rn encodingName = "UTF-8";rn enable = false;rn rnrn // 初始化rn public void init(FilterConfig filterConfig) throws ServletException rn this.filterConfig = filterConfig;rn rnrn // 每个请求设置UTF-8rn public void doFilter(ServletRequest request, ServletResponse response,rn FilterChain chain) throws IOException, ServletException rn request.setCharacterEncoding("UTF-8");rnrn HttpServletRequest httprequest = (HttpServletRequest) request;rn HttpServletResponse httpresponse = (HttpServletResponse) response;rn HttpSession session = httprequest.getSession(); rn AdminUser user=new AdminUser();rn try //获得在session中所记录的isLogin属性,该属性由登录部分的代码写入 rn user = (ActingAdminUser) session.getAttribute("user");rn if (user!=null) //验证成功,继续处理rn rn chain.doFilter(request, response);rn else //验证不成功,让用户登录。rn rn String targetURL = httprequest.getContextPath()+"/login.jsp";rn httpresponse.sendRedirect(targetURL); rn rn catch (Exception e) rn e.printStackTrace();rn rn rn rn public void destroy() rn rnrnrnrn[/code]rn我想实现判断session用户是否登录了rn我配了这个,是在编码过滤器那里顺便加点session判断,但是我开个网页都卡在那里,好像在反复重定向,左下角闪烁正在打开"http://localhost:8080/test/login.jsp" 和 "正在重新定向到http://localhost:8080/test/login.jsp" 我写错哪里了?
我的dijksta哪里写错了
杭电2544最短路,dijkatra哪里写错了。。。rn#includern#includern#includern#includernusing namespace std;rn#define inf 0x3f3f3frn#define maxn 300rnrnint n,m;rnint mp[maxn][maxn];rnint vis[maxn],dis[maxn];rnrnvoid dijkstra()rn int i,j,pos,min;rn int s=1; //源点是1路口rn memset(vis,0,sizeof(vis));rn dis[s]=0,vis[s]=1;rn //dis[i]记录源点到点i之间的距离rn for(i=1;i<=n;i++)rn dis[i]=mp[s][i];rn for(i=1;i<=n;i++)rn min=inf;rn //每一次找到还未访问,也就是在集合外的点到源点的最小距离rn for(j=1;j<=n;j++)rn if(dis[j]dis[pos]+mp[pos][j] )rn dis[j]=dis[pos]+mp[pos][j];rn rn rn rnrnrnint main()rn int i,j,u,v,w;rn while(~scanf("%d%d",&n,&m)) //n个路口,m条边rn if(n==0&&m==0) break;rn for(i=1;i<=n;i++)rn for(j=1;j<=n;j++)rn mp[i][j]=inf;rn mp[i][i]=0;rn rn for(i=0;iw) //防止重路rn mp[u][v]=mp[v][u]=w;rn rn dijkstra();rn printf("%d\n",dis[n]);rn rn return 0;rnrnrn
求助 我哪里理解错了
#include "stdio.h"rnvoid main()rn int x,a,b,c,d,e,s=5,m;rn scanf("%d",&x);rn if (x<100000)rn a=x/10000 ;rn x=x-a*10000;rn b=x/1000;rn x=x-b*1000;rn c=x/100;rn x=x-c*100;rn d=x/10;rn x=x-d*10;rn e=x/1;rn rn if (a==0)rn s=s-1;rn m=1000*e+100*d+10*c+1*b;rn printf("%d %d %d %d\n 输入的位数为:%d\n逆向输出为:%d\n",b,c,d,e,s,m);rn rn else if ((a==0)&&(b==0))rn s=s-2;rn m=100*e+10*d+1*c;rn printf("%d %d %d\n 输入的位数为:%d\n逆向输出为:%d\n",c,d,e,s,m);rn rn else if ((a==0)&&(b==0)&&(c==0))rn s=s-3;rn m=10*e+1*d;rn printf("%d %d\n 输入的位数为:%d\n逆向输出为:%d\n",d,e,s,m);rn rn else if ((a==0)&&(b==0)&&(c==0)&&(d==0))rn s=s-4;rn m=1*e;rn printf("%d %d\n 输入的位数为:%d\n 逆向输出为:%d\n",e,s,m);rn rn rnrn输入一个不多于五位数的正整数 rn求它是几位数rn分别输出每一位数字rnrn逆序输出该数 如原数321rn输出123rnrn好像第一个IF里面a并不等于零 下面的if就都不成立了啊.为什么能输出结果呢.rnrn逻辑与是所有条件都得成立才能执行的吧?rnrnrn
哪里错了哪里错了我是按照书上写的
main()nnint shuzu[5]=1,4,2,8,7;nint i,j;nfor(i=0;i<5;i++);nfor(j=1;j<=i;j++);nif(shuzu[j-1]>shuzu[j])nnint a=shuzu[j-1];nshuzu[j-1]=shuzu[j];nshuzu[j]=shuzu[j-1];nnfor(i=0;i<5;i++)printf("%d\n",shuzu[i]);n
ajax 我真不知道我哪里写错了
rn 挂载目标实例rn rn rn 请选择挂载目标rn Yun 你是谁rn rn rnrnrnrn rnrnrn后台CS代码rn /// rn /// 计算价格rn /// rn /// rn /// rn [WebMethod]rn public static string Queding(string snhao,string daxiao)rn rnrn return null;rnrn rnrnrnrnrnrn上面就是代码 以前我用注册的时候 都是这样传值 传2个值来判断账号密码是否正确 今天换了一个页面 复制代码过来 发现2个值根本无法传值到后台 一只提示错误[img=https://img-bbs.csdn.net/upload/201906/20/1561009769_483635.png][/img]rn整了几个小时了 一直这样 没办法在后台获取到值 rn但是我发现一个问题 我上面是传2个值的 我改成只传一个值snhao 他就能成功 只要1个以上就失败 有懂的大佬吗rnrnrnrnrnrnrnrnrn
这段哪里写错了
这段错在哪里呀?IE提示这里的第一行就有错。缺“;”rn var XmlHttp = New ActiveXObject("Microsoft.XMLHTTP");rn XmlHttp.Open("POST","ExamCorp.asp?id="+Register.C_Corp.value,false);rn XmlHttp.Send();rn var tmpExamCorp = XmlHttp.responseTextrn
这样写哪里错了?
[code=html]rnrnrn rn rn rnrnrn[/code]rnrn运行之后报错:无法将类型“string”隐式转换为"bool"rnrn
这样写哪里错了?
编辑rnrn为什么一点反应也没有的?rnrn编辑rnrn这样也没有...rnrn应该怎么写
这样写哪里错了!!
select top 12 * from cgzp where class2='酷绚' and not in(select top 5 * from cgzp where class2='酷绚' order by id desc) order by id desc
急 求助!!我的类哪里写错了 帮忙指下
width=$width;rn $this->height=$height;rn $this->num=$num;rn $this->disnum=$disnum;rn $this->strcode=$this->createCode();rn $this->iscurve=$iscurve;rn rn rnrn public function createCode()rn $this->createImage();rn $this->createStrCode();rn $this->writeCode();rn $this->createDisCode();rn if($iscurve)rn $this->createDisCurve();rn rn $this->imageType();rn rnrn public function outCode()rn return $this->strcode;rn rnrn private function createImage()//创建画布rn $this->image = imagecreatetruecolor($this->width, $this->height);rn $bgcolor = imagecolorallocate($this->image, 255, 255, 255);rn $reccolor = imagecolorallocate($this->image, 0, 0, 0);rn imagefill($this->image, 0, 0, $bgcolor);rn imagerectangle($this->image, 1, 1, $this->width-2, $this->height-2, $reccolor); rn rnrn private function createStrCode()//生成字符串验证码rn $text="";rn for($i=0; $i<$this->codenum; $i++)rn switch(rand(0, 2))rn case 0:rn $text.= sprintf("%c", rand(48,57));rn break;rn case 1:rn $text.= sprintf("%c", rand(65, 90));rn break;rn case 2:rn $text.= sprintf("%c", rand(97, 122));rn break;rn rn rn return $text;rn rn rn private function writeCode() //把字符串写入图片中 rn for($i=0;$i<$this->codenum;$i++)rn $col=imagecolorallocate($this->image,rand(0,255),rand(100,255),rand(0,255));rn $x=floor($this->width/$this->codenum)*$i+rand(2,10);rn $y=rand(0,$this->height-15);rn imagechar($this->image,2,$x,$y,$this->strcode[$i],$col); rn rn rnrn private function createDisCode()//生成干扰元素rn for($i=0;$i<$disnum;$i++)rn $col=imagecolorallocate($this->image,rand(0,255),rand(0,255),rand(0,255));rn imagesetpixel($image,rand(0,$this->width-2),rand(0,$this->height-2),$col);rn rn rnrn private function createDisCurve()//生成干扰曲线rn for($i=0; $i<3; $i++)rn $curvecolor = imagecolorallocate($this->image, rand(180, 200), rand(180, 200), rand(180, 200));rn imagearc($this->image, rand(0, $this->width), rand(0, $this->height), rand($this->width, 2*$this->width), rand($this->height, 2*$this->height), rand(0, 90), rand(180, 360), $curvecolor);rn rn rnrnrn private function imageType()rn if(imagetypes() & IMG_GIF)rn header("content-type:images/gif");rn imagegif($this->image);rn elseif(imagetypes() & IMG_JPG)rn header("content-type:images/jpeg");rn imagejpeg($this->image);rn elseif(imagetypes() & IMG_PNG)rn header("content-type:images/png");rn imagepng($this->image);rn elseif(imagetypes() & IMG_WBMP)rn header("content-type:images/vnd.wap.wbmp");rn imagewbmp($this->image);rn elsern die("此格式不支持");rn rn rnrn function __destruct()//销毁图片rn imagedestroy($this->image);rn rn rn?>
【求助】 哪里出错了?
Inputrn每组输入数据占3行,第一行是2个整数 n ( 0 < n ≤ 100 ) 和 m ( 0 < m ≤ 100 ) ,分别表示集合A和集合B的元素个数。rn第二行是n个整数,表示集合A的n个元素。rn第三行是m个整数,表示集合B的m个元素。rn每个元素为不超出int范围的整数,元素之间有一个空格隔开。rn如果n=0并且m=0表示输入的结束,不做处理。rnrnOutputrn针对每组数据输出一行数据,表示A-B的结果,如果结果为空集合,则输出"NULL",否则从小到大输出结果。 两个元素之间有一个空格,行末没有空格。rnrnSample Inputrn3 3rn1 2 3rn1 4 7rn3 7rn2 5 8rn2 3 4 5 6 7 8rn0 0rnrnSample Outputrn2 3rnNULLrnrn[code=c]#includernvoid bubble(int p[],int t);rnint main()rnrn int i,j,n,k,m,t,a[101],b[101],p[101];rn while(scanf("%d%d",&n,&m)!=EOF)rn rn if(n==0&&m==0)rn break;rn t=n;rn for(i=0;ip[j+1])rn rn s=p[j];p[j]=p[j+1];p[j+1]=s;rn rn rn[/code]
哪里错了?求助!
│struct │rn│ │rn│char name; │rn│int number[10]; │rn│float result; │rn│ union │rn│ │rn│ int class; │rn│ char stu[10]; │rn│ │rn│student[10]; │rn│ │rn│ │rn│min(int x,int y) │rn│ │rn│ int z; │rn│ if (x>y); │rn│ z=y; │rn│ y=x; │rn│ x=z; │rn│ │rn│ │rn│main() │rn│ │rn│int i; │rn│for(i=0;i<10;i++) │rn│ │rn│ printf("please input information\n"); │rn│ scanf("%c%d%f,&student[i].name,student[i].number,student[i].result"); │rn│ min(student[i].result,student[i+1].result); │rn│ printf("\n"); │rn│ printf("name number result\n"); │rn│ printf("%c%d%d\n",student[i].name,student[i].number,student[i].result │rn│ │rn│ │rn│ │rn│ │rn├────────────────────────────────── Message ───────────────────────────────────┤rn│ Compiling C:\11.C: │rn│ Error C:\11.C 30: Undefined symbol 'student' in function main │rn│ Error C:\11.C 30: Invalid indirection in function main │rn│ Error C:\11.C 30: Invalid indirection in function main │rn│•Error C:\11.C 33: Invalid indirection in function main │rn│ Error C:\11.C 33: Invalid indirection in function main │rn│ Error C:\11.C 33: Invalid indirection in function main │
【求助】看看哪里错了?
Inputrn输入第一行是一个T 代表有多少组测试数据rn每组测试数据的第一行是一个整数n,代表该局比赛有几个玩家rn接下来有n行,每行是三个整数 a:b:crn其中第一行为我的成绩rnrnOutputrn对于每一组输入,输出一个整数,也就是我在该局比赛的名次(ranking)。rnrnSample Inputrn1rn3rn2:02:123rn2:03:000rn2:02:124rnrnrn[code=c]rn#includernint main()rnrn int t,i,n,m,sum;rn int a[100],b[100],c[100];rn char op;rn scanf("%d",&t);rn for(i=1;i<=t;i++)rn rn sum=0;rn scanf("%d",&n);rn for(m=0;m
求助 看下哪里错了
一个很简单的加密解密算法 rnrnrn//加密 rnprivate string Code(string source)rn rn char[] password = source.ToCharArray();rn rn StringBuilder sb=new StringBuilder();rnrn for (int i = 0; i < password.Length; i++)rn rn int a =(int) password[i]+1;rn char ch =(char) a;rn sb.Append(ch);rnrn rn return sb.ToString();rn rnrn //解密rnrn private string Decode(string source)rn rn char[] password = source.ToCharArray();rnrn StringBuilder sb = new StringBuilder();rnrn for (int i = 0; i < password.Length; i++)rn rn int a = (int)password[i] -1;rn char ch = (char)a;rn sb.Append(ch);rn rn return sb.ToString();rn rn rnrn加密与解密后不一样 rn看下哪错了rnrn没分了。。
求助,不知道哪里错了。
#include rn#include rn#include rn#include rnrn#define ListSize 10rnvoid Error(char *message)rnrn printf("Error:%s\n",message);rn exit(1);rnrnstruct SeqList rnrn int data[ListSize];rn int length;rn;rnvoid InitList(struct SeqList *L)rnrn L->length=0;rnrnvoid ListInsert(struct SeqList *L,int x,int i)rnrn int j;rn if(i<0||i>L->length)rn Error("position error");rn if(L->length>=ListSize)rn Error("overflow");rn for(j=L->length-1;j>=i;j--)rn L->data[j+1]=L->data[j];rn L->data[i]=x;rn L->length++;rnrnvoid DeleteList(struct SeqList *L,int i)rnrn int j;rn if(i<0||i>L->length-1)rn Error("position error");rn if(j=i+1;jlength;j++)rn L->data[j-1]=L->data[j];rn L->length--;rnrnint main()rnrn struct SeqList *SEQA;rn int i;rn SEQA=(struct SeqList *)malloc(sizeof(struct SeqList));rn if(!SEQA)rn Error("no space.\n");rn InitList(SEQA);rn for(i=0;idata[i]);rn rn printf("\n");rn DeleteList(SEQA,6);rn DeleteList(SEQA,0);rn DeleteList(SEQA,5);rn for(i=0;ilength;i++)rn rn printf("%3d",SEQA->data[i]);rn rn ListInsert(SEQA,1,0);rn ListInsert(SEQA,2,3);rn ListInsert(SEQA,3,9);rn for(i=0;ilength;i++)rn printf("%3d",SEQA->data[i]);rn _getch();rn return 0;rnrn在vc6.0下,编译后有三处错误,不知道哪里错了,望大神指点
不知道哪里错了,求助!!!
string ls_1,ls_2,lb,ldrnls_1=sle_1.textrnls_2=sle_2.textrndeclare cursor1 cursor for select A,B from ppp ;rnopen cursor1;rnfetch cursor1 into :lb,:ld;rndo while sqlca.sqlcode=0rn if ls_name=lb and ls_password=ld then rn open(main)rn close(ssssssssss)rn else rn messagebox ("adsa","sdfsdf!")rnfetch cursor1 into :lb,:ld;rnlooprnclose cursor1;rn表里数据如下:rn A Brn 123 123rn aaa bbb 数据类型为verchar.rn可是不管我输入哪个都提示错误rn如果我改成 long ls_1,ls_2,lb,ldrn ls_1=long(sle_1.text)rn ls_2=long(sle_2.text) rn然后输入123那行却没有问题rn这是为什么呢,麻烦知道的告诉我,谢谢了rn
T-T求助 哪里错了
#includern#includern#includernconst int Arsize = 100;rnusing namespace std;rnint main()rnrn int num;rn struct carrn rn string name;rn int time;rn ;rn vectordata;rn car *BaseRecord;rn rn cout << "How many cars do you wish to catalog?";rn cin >> num;rn for (int i = 0; i < num; ++i)rn rn BaseRecord = new car;rn cout << "Car #" << i + 1 << ":" << endl;rn cout << "Please enter the make:" ;rn getline(cin, BaseRecord->name);rn cout << "Please enter the year made:";rn cin >> BaseRecord->time;rn data.push_back(BaseRecord);rn delete[]BaseRecord;rn rn cout << "Here is your collection:" << endl;rn for (int i = 0; i < data.size(); ++i)rn cout << data[i]->time << " " << data[i]->name << endl;rn cin.get();rn cin.get();rn return 0;rn
求助哪里错了?
#includern#includernrn#define LEN 100rn#define MAX 100rn#define IN 1rn#define OUT 0rnrnrnint main (void)rnrn int i;rn int j;rn char a1[LEN];rn char b1[LEN];rn int a[LEN];rn int b[LEN];rn int statue;rn int lens1, lens2;rnrn memset(a, 0, sizeof(a));rn memset(b, 0, sizeof(b));rn scanf("%s", a1);rn scanf("%s", b1);rn lens1 = strlen(a1)-1;rn lens2 = strlen(b1)-1;rn rn j = 0;rn for(i = lens1; i >= 0; i--)rn rn a[j++] = a1[i] - '0';rn rn j = 0;rn for(i = lens2; i >= 0; i--)rn rn b[j++] = b1[i] - '0';rn rn for(i = 0; i < MAX; i++)rn rn a[i] += b[i];rn if(a[i] >= 10)rn rn a[i] -= 10;rn a[i+1]++;rn rn rn rn rn statue = OUT;rn for(i = MAX; i >= 0; i--)rn rn if(statue)rn rn printf("%d", a[i]);rn rn else if(a[i])rn rn printf("%d", a[i]);rn statue = IN;rn rn rn rn putchar('\n');rnrnrnrn大整数加法的问题,为什么讲MAX改小比如50 才能得出结果。rn小弟新手 rn不解..求帮助 谢谢rnrn
求助,不知道哪里错了
程序如下rn#include rn#includernusing namespace std;rnclass studentrnprivate:rnint num;rnstring name;rnstring sex;rnfloat s1,s2,s3;rnpublic:rn student(int num=0,string name=0,string sex=0,float s1=0,float s2=0,float s3=0)rn this->num=num;rn this->name=name;rn this->sex=sex;rn this->s1=s1;rn this->s2=s2;rn this->s3=s3;rn rn student(student &p)rn num=p.num;rn name=p.name;rn sex=p.sex;rn s1=p.s1;rn s2=p.s2;rn s3=p.s3;rnrn rn void setinfo(int num,string name,string sex,float s1,float s2,float s3)rn this->name=name;rn this->num=num;rn this->sex=sex;rn this->s1=s1;rn this->s2=s2;rn this->s3=s3;rn rn void getinfo(int &n,string &nam,string &se,float &sc1,float &sc2,float &sc3)rn n=num;rn nam=name;rn se=sex;rn sc1=s1;sc2=s2;sc3=s3;rn rn void show()rn cout<<"学号:"<>num>>name>>sex>>s1>>s2>>s3;rn std[i].setinfo(num,name,sex,s1,s2,s3);rn rnrnfor(i=0;i<5;i++)rncout<<"输出第"<>number;rnfor(i=0;i<5;i++)rnstd[i].getinfo(num,name,sex,s1,s2,s3);rnif(number==num) std[i].show();rnrncout<<"每门课成绩都大于85分的学生:"<<'\n';rnfor(i=0;i<5;i++)rnstd[i].getinfo(num,name,sex,s1,s2,s3);rn if(s1>85&&s2>85&&s3>85) cout<
VC++6.0 我这样写哪里错了呢?
[code=C/C++]#include rnint main()rnrn FILE * fp;rn char c;rn c = getchar();rn if((fp = fopen(ccc.c,"w")) == NULL)rn rn printf("cannot open file\n");rn exit(0);rn rn fputc(c,fp);rn fclose(fp);rnrnrn return 0;rn[/code]
请问大虾,我是哪里写错了?
错误类型:rnMicrosoft VBScript 运行时错误 (0x800A01A8)rn缺少对象: ''rn/update.asp, 第 8 行rnrnrn浏览器类型:rnMozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) rnrn网页:rnPOST 101 ??? /update.asprnrnPOST Data:rntext1=&rdo1=100&rdo2=100&rdo4=80&rdo5=80&rdo6=80&rdo8=60&rdo9=80&rdo10=60&rdo11=60&rdo12=60&textarea=rnrnupdate.asprnrn<%rnoption explicitrndim conn,connstr,startime,db,rs,dblinkrndb="db.mdb"rnSet conn = Server.CreateObject("ADODB.Connection")rnconnstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")rnconn.Open connstrrnrs.open "select * from mian",conn,1,4 rnrs("text1")=request("班级")rnfor i=1 to 12 rn rs("m"&i)=request("rdo"&i) rn rs.update rn rs.movenext rnnext rnrs.close rnset rs=nothing rnconn.close rnset conn=nothing%>"rn请问大虾,我是哪里写错了?rn
我写的扫雷游戏 不知道哪里错了
#include "stdio.h"rn#include "stdlib.h"rn#define SPA 0 //代表空白rn#define BOMB 1 //代表雷rn#define SAFE 2 //代表已翻开的空白rn#define N 16rnvoid change(int m,int *i,int *j);rnint number(int x,int y);rnint num=N*N;//可翻的格的数目rnint dilei[N+2][N+2]=SPA; //边界各2rnint eye[N][N]=SPA; rnvoid suiji()rnrn int i,j;rn for(i=1;i
请问高手,我写的代码哪里错了??
1 from Tkinter import *rn2 from tkMessageBox impor *rn3 import socketrn4 a=socket.gethostname()rn5 b=socket.gethostbyname(a)rn6 def button_click():rn7 showinfo('heelo,world',a+'\n'+b)rn8 root=Tk()rn9 c=Button(root,text='Get',command=button_click)rn10 c.pack(side=TOP)rn11 root.mainloop()rn我用的是python2.5.1版本idle,请问哪里错了?我总是不能运行??是不是python的版本不一样,编写代码的语法也不一样??
我这个删除节点的函数哪里写错了?
node*del(node*head,char num[])//删除一个节点;rnrn node*p1,*p2;rn p1=head;rn p2=head; rn dorn //rn p2=p1;rn p1=p1->next;//rn if(strcmp(p1->data.xuehao,num)==0)rn rn p2->next=p2;rn cout<<"找到了该学生信息;"<next;rnrn rn while(p1!=NULL);rnrn cout<<"没有找到该学生信息"<
查询数据的问题。 我哪里写错了??
rn[code=C#]rn public static int insertDataQu(string cmdString)rn rn string connString = "server=.\\SQLEXPRESS;database=stumanage;uid=sa;pwd=sa"; rn using (SqlConnection conn = new SqlConnection(connString))rn rn using (SqlCommand cmd = new SqlCommand(cmdString, conn))rn rn conn.Open();rn int count = cmd.ExecuteNonQuery();rn return count;rn rn rn rn[/code]rnrn[code=C#]rn private void insertBut_Click(object sender, EventArgs e)rn rn string myclass=cName.Text;rn string myteacher=cTea.Text;rn string cmdString = "select count(c_class) from classinfo where c_class='" + myclass + "'";rn int aa =DB.insertDataQu(cmdString);rn MessageBox.Show(aa.ToString());rn rn rn[/code]rnrn我检索表 chlassinfo 里面的字段 c_class 为什么返回的数字是-1? 我存在这个数据的啊。 不是应该返回1么?rn什么原因? 哪里错了??
我写的拆分字符串,哪里错了?
编辑框2.内容 rn比如是这样的内容1+1=?A.0B.1C.2D.3 rn用“A.”“B.”“C.”“D.”这四个分隔符,将编辑框2.内容拆分到编辑框2到6中 rn即编辑框2.内容是 1+1=? rn 编辑框3.内容是 0 rn 编辑框4.内容是 1 rn 编辑框5.内容是 2 rn 编辑框6.内容是 3 rn我写了段代码,哪里错了?rn用到的三个方法rn调用格式: 〈整数型〉 寻找文本 (文本型 被搜寻的文本,文本型 欲寻找的文本,[整数型 起始搜寻位置],逻辑型 是否不区分大小写) - 系统核心支持库->文本操作rn 英文名称:InStrrn 返回一个整数值,指定一文本在另一文本中最先出现的位置,位置值从 1 开始。如果未找到,返回-1。本命令为初级命令。rn 参数<1>的名称为“被搜寻的文本”,类型为“文本型(text)”。rn 参数<2>的名称为“欲寻找的文本”,类型为“文本型(text)”。rn 参数<3>的名称为“起始搜寻位置”,类型为“整数型(int)”,可以被省略。位置值从 1 开始。如果本参数被省略,默认为 1 。rn 参数<4>的名称为“是否不区分大小写”,类型为“逻辑型(bool)”,初始值为“假”。为真不区分大小写,为假区分。rn 调用格式: 〈文本型〉 取文本左边 (文本型 欲取其部分的文本,整数型 欲取出字符的数目) - 系统核心支持库->文本操作rn 英文名称:leftrn 返回一个文本,其中包含指定文本中从左边算起指定数量的字符。本命令为初级命令。rn 参数<1>的名称为“欲取其部分的文本”,类型为“文本型(text)”。rn 参数<2>的名称为“欲取出字符的数目”,类型为“整数型(int)”。rnrn调用格式: 〈文本型〉 取文本右边 (文本型 欲取其部分的文本,整数型 欲取出字符的数目) - 系统核心支持库->文本操作rn 英文名称:rightrn 返回一个文本,其中包含指定文本中从右边算起指定数量的字符。本命令为初级命令。rn 参数<1>的名称为“欲取其部分的文本”,类型为“文本型(text)”。rn 参数<2>的名称为“欲取出字符的数目”,类型为“整数型(int)”。rnrnrn算法如下:rna1 = 寻找文本 (编辑框2.内容, “A.”, , 假)rn.如果 (a1 > 0)rn a2 = 取文本右边 (编辑框2.内容, a1 + 2)rn 编辑框2.内容 = 取文本左边 (编辑框2.内容, a1)rn a1 = 寻找文本 (a2, “B.”, , 假)rn .如果 (a1 > 0)rn a2 = 取文本右边 (a2, a1 + 2)rn 编辑框3.内容 = 取文本左边 (a2, a1)rn a1 = 寻找文本 (a2, “C.”, , 假)rn .如果 (a1 > 0)rn a2 = 取文本右边 (a2, a1 + 2)rn 编辑框4.内容 = 取文本左边 (a2, a1)rn a1 = 寻找文本 (a2, “D.”, , 假)rn .如果 (a1 > 0)rn 编辑框5.内容 = 取文本左边 (a2, a1)rn 编辑框6.内容 = 取文本右边 (a2, a1 + 2)rnrn .否则rnrn .如果结束rnrn .否则rnrn .如果结束rnrn .否则rnrn .如果结束rnrn.否则rnrn.如果结束
我哪里写错了,为什么总出错????
<% @Language = VBScript %>rn<%rn Option Explicitrn Dim rs, conn, sql, strConnrn Set conn = Server.CreateObject("ADODB.Connection")rnrn strConn = "Provider=Microsoft.JET.OLEDB.4.0; Data Source=" & Server.Mappath("db1.mdb")rn conn.open strConnrnrn conn.closern Set conn = Nothingrn%>rn'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''rn错误类型:rnMicrosoft JET Database Engine (0x80004005)rn/test.asp, 第 8 行rn
紧急求助,我的SQL语句哪里错了??
SELECT * FROM [User] WHERE ","&[UserName]&"," Like '%,111,%' rn这条语句的作用是将ABC表中的UserName字段的内容两边各加上一个逗号后再查出相应记录,比如原内容是 张三 加上一个逗号后是 ,张三, rnrn此语句在ACC2007下能正常使用,在MSSQL2005下出现问题,“列名无效”rnrn又改用下面语句:rnSELECT * FROM [User] WHERE ','+UserName+',' Like '%,111,%' rnrn在ACC2007下能正常使用,在MSSQL2005下出现问题,“数据类型 VARCHAR 和TEXT 在ADD运算中不兼容”rnrn表 Userrn字段 ID UserNamern数据 1 张三rn 2 李四,张三rn 3 张三丰rn 4 王五rn如上:我要查出UserName中包含张三的记录,这里面第二条记录有特殊情况,只能用UserName like ,但第三条记录又有特殊情况,不能直接用UserName like ,否则会查出第三条记录,根据第二条记录的情况,只能是在UserName内容的两边加上一个逗号,才能正确查出记录。rnrn [b]加上逗号[/b]rn字段 ID ,UserName,rn数据 1 ,张三,rn 2 ,李四,张三,rn 3 ,张三丰,rn 4 ,王五,rn这样的话,后面再跟Like语句,查询like '%,张三,%' 就没有问题,正确结果是第一、二条记录.rn我不希望修改UserName的内容,希望一条SQL查询语句搞定rn到底要怎样写呀,请高手赐教!!!!
我的代码哪里错了?
If Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 0 And Check4.Value = 0 ThenrnAdodc1.RecordSource = "select * from 项目信息 where 申报日期 between '" + Chr(35) + Str(DTPicker1.Value) + Chr(35) + "' and '" + Chr(35) + Str(DTPicker2.Value) + Chr(35) + "'"rnAdodc1.RefreshrnEnd Ifrnrn这个代码老是出现说对象refresh方法的IACODC失败
我哪里错了?
题目:rn编写一个整钱兑零程序,该程序能够将用double类型表达的钱数兑换成相应的硬币,要求精确到分。(硬币的面值有1元、5角、1角、5分、2分、1分,如果输入:12.53,结果应该为:12(1元),1(5角),1(2分),1(1分))。rnrnrn我写的代码如下,大家可以运行下,看看,有BUG,但我没找出错在哪rn[code]import javax.swing.*;rnpublic class Ex_1rn rnpublic static void main(String args[])rnrnString amountString=JOptionPane.showInputDialog(null,"请输入钱数","整钱兑零",JOptionPane.QUESTION_MESSAGE); rndouble amount=Double.parseDouble(amountString);rnint y=(int)amount; //把amount转换为整型rndouble y2=(double)y; //把y转换为double型rnint j5=(int) ((amount-y2)/0.5);rnint j1=(int)((amount-y2-j5*0.5)/0.1);rnint f5=(int)((amount-y2-j5*0.5-j1*0.1)/0.05);rnint f2=(int)((amount-y2-f5*0.05-j5*0.5-j1*0.1)/0.02);rnint f1=(int)((amount-y2-f5*0.05-j5*0.5-j1*0.1-f2*0.02));rnSystem.out.println(y+"(1元)"+j5+"(5角)"+j1+"(1角)"+f5+"(5分)"+f2+"1(2分)"+f1+"(1分)");rnrnrn[/code]
我这哪里错了
#include rn#include rn#include rn#include rnrnusing namespace std;rnclass GTrnrn int b;rnpublic:rn GT(int v=0):b(v)rn bool operator()(const string &s)rn return s.size()>=b;rn;rnint main()rnrn string s("aaaaa");rn for(int i=0;i!=10;++i)rn cout<
我的概念哪里错了
我想问的是(1)我标红的地方全部都用到了下面标蓝的地方的隐式转换吗?rn (2)我的程序为什么显示的是faem1:delete2.Farm`1[delete2.Cow] farm2:delete2.Farm`1[delete2.Animal],以我的概念应该显示faem1:delete2.Farm`1[delete2.Animal] farm2:delete2.Farm`1[delete2.Animal],因为以我的概念传给重载运算符的参数应该是这样的形式:Farm farm1=dairyFarm,Farm farm2=farm,由于T是约束类型Animal代入到T,应该是我划红的地方第一个参数应该是这样的形式Farm farm1=dairyFarm,由于dairyFarm是Farm,因此调用隐式转换public static implicit operator Farm(Farm farm) 我的概念哪里错了?请高人指点 谢谢了 高分献上rnrn代码如下:rnusing System;rnusing System.Collections.Generic;rnusing System.Linq;rnusing System.Text;rnusing System.Threading.Tasks;rnusing System.Collections;rnnamespace delete2rnrn public class Farm : IEnumerablern where T : Animalrn rn private List animals = new List();rn public List Animalsrn rn getrn rn return animals;rn rn rnrn public IEnumerator GetEnumerator()rn rn return animals.GetEnumerator();rn rnrn IEnumerator IEnumerable.GetEnumerator()rn rn return animals.GetEnumerator();rn rnrn public void MakeNoises()rn rn foreach (T animal in animals)rn rn animal.MakeANoise();rn rn rn public void FeedTheAnimals()rn rn foreach (T animal in animals)rn rn animal.Feed();rn rn rnrn public Farm GetCows()rn rn Farm cowFarm = new Farm();rn foreach (T animal in animals)rn rn if (animal is Cow)rn rn cowFarm.Animals.Add(animal as Cow);rn rn rn return cowFarm;rn rn rnrn public static Farm operator +([color=#FF0000]Farm farm1, Farm farm2[/color])rn rn Console.WriteLine("faem1:0 farm2:1", farm1.GetType(), farm2.GetType());rn Farm result = new Farm();rn foreach (T animal in farm1)rn rn result.Animals.Add(animal);rn rn foreach (T animal in farm2)rn rn if (!result.Animals.Contains(animal))rn rn result.Animals.Add(animal);rn rn rn return result;rn rnrn [color=#0000FF]public static implicit operator Farm(Farm farm)rn rn Farm result = new Farm();rn foreach (T animal in farm)rn rn result.Animals.Add(animal);rn rn return result;rn [/color]rn rnrn public class SuperCow : Cowrn rn public void Fly()rn rn Console.WriteLine("0 is flying!", name);rn rn public SuperCow(string newName)rn : base(newName)rn rn public override void MakeANoise()rn rn Console.WriteLine("0 says 'here I come to save the day!'", name);rn rn rnrn public class Cow : Animalrn rn public void Milk()rn rn Console.WriteLine("0 has been milked.", name);rn rn public Cow(string newName)rn : base(newName)rn rn public override void MakeANoise()rn rn Console.WriteLine("0 says 'moo!'", name);rn rn rnrn public class Chicken : Animalrn rn public void LayEgg()rn rn Console.WriteLine("0 has laid an egg.", name);rn rn public Chicken(string newName)rn : base(newName)rn rn rn public override void MakeANoise()rn rn Console.WriteLine("0 says 'cluck!';", name);rn rn rnrn public abstract class Animalrn rn protected string name;rn public string Namern rn getrn rn return name;rn rn setrn rn name = value;rn rn rn public Animal()rn rn name = "The animal with no name";rn rn public Animal(string newName)rn rn name = newName;rn rn public void Feed()rn rn Console.WriteLine("0 has been fed.", name);rn rn public abstract void MakeANoise();rn rnrnrn class Programrn rn static void Main(string[] args)rn rn Farm farm = new Farm();rn farm.Animals.Add(new Cow("Jack"));rn farm.Animals.Add(new Chicken("Vera"));rn farm.Animals.Add(new Chicken("Sally"));rn farm.Animals.Add(new SuperCow("Kevin"));rn farm.MakeNoises();rnrn Farm dairyFarm = farm.GetCows();rn dairyFarm.FeedTheAnimals();rnrn foreach (Cow cow in dairyFarm)rn rn if (cow is SuperCow)rn rn (cow as SuperCow).Fly();rn rn rnrn Farm newFarm =dairyFarm+ farm ;rnrn rn Console.ReadKey();rn rn rn
我哪里错了
string b = "102648455";rn string MessageBody = "请进行邮箱验证来完成您注册的最后一步,点击下面的链接激活您的帐号: 激活"; //邮件内容 (一般是一个网址链接,生成随机数加验证id参数,点击去网站验证。)rn Response.Write(MessageBody);rnrnrn输出后的按钮超链接 都是rnhttp://www.jj86.com/OK?id=rnrn后面的都没有了。。
我的javascript哪里错了?
rnrnrn rn rnrnrn rnrnrn我的程序哪里错了? rn我获得了钥匙 但是去门那里的时候总是提示我没有钥匙?
我不知道哪里错了。。
rnimport java.util.Scanner;rnrnpublic class NewClass rn Student student = new Student();rn int n;rn public void init(Student student) rn System.out.println("How many students do you want to input?");rn Scanner str = new Scanner(System.in);rn n = str.nextInt();rn student.scores = new int[n];rn student.number = new String[n];rn student.name = new String[n];rn System.out.println("Please input " + n + " students' number,name and scores");rn Scanner string = new Scanner(System.in);rn Scanner string1 = new Scanner(System.in);rn Scanner string2 = new Scanner(System.in);rn for (int i = 0; i < n; i++) rn student.number[i] = string.nextLine();rn student.name[i] = string1.nextLine();rn student.scores[i] = string2.nextInt();rn rn sort(student);rn rnrn public void sort(Student student) rnrn String numbertemp, nametemp;rn int scorestemp;rn for (int i = 0; i < n - 1; i++) rn for (int j = 1; j < n; j++) rn if (rn student.scores[i] < student.scores[j]) rn numbertemp = student.number[i];rn student.number[i] = student.number[j];rn student.number[j] = numbertemp;rn nametemp = student.name[i];rn student.name[i] = student.name[j];rn student.name[j] = nametemp;rn scorestemp = student.scores[i];rn student.scores[i] = student.scores[j];rn student.scores[j] = scorestemp;rn rn rn rn output(student);rn rnrn public void output(Student student) rn for (int i = 0; i < n; i++) rn System.out.println(student.name[i]);rn rn rnrn public static void main(String args[]) rn NewClass application = new NewClass();rnrn application.init(student);rn rnrnclass Studentrn rn String number[];rn String name[];rn int scores[];rn Student(String number[],String name[],int scores[])rn this.name = name;rn this.number = number;rn this.scores = scores;rn rnrn Student() rn throw new UnsupportedOperationException("Not yet implemented");rn rn
我这里哪里错了
不管我数据库里面有没有数据,response.write(check.eof)rn输出TRUE,怎么回事,check.eof,我感觉就有点象结束判断标志,但我看很多程序都是用的它,我也用了,是不是错了?该用什么判断我的SQL找到结果了,rn<%rn username=request.form("user")rn password=request.form("psd") rn 'response.write(username)rn 'response.write(password)rn set sxyconn=Server.CreateObject("ADODB.Connection") rn sxyconn.Open "Driver=sql server;Server=127.0.0.1;Database=sxyxx;UID=123;PWD=654"rn sql=" select * from 用户表 where 用户名=' "&username&" ' and 密码=' "&password&" '" rn set check =sxyconn.execute(sql)rn response.write(check.eof)rn ' if check.eof thenrn ' Response.Redirect("sxy.asp")rn ' else response.write("用户名或密码错误")rn ' End ifrn sxyconn.closern %>
我的strcpy哪里错了?
void mystrcpy (char* to, const char* from)rnrn to = new char[mystrlen(from)+1];rn for (; *from != 0; ++from, ++to)rn rn *to = *from;rn rn *to = 0;rnrn运行时说一段内存不能读,正确的该怎么写?
相关热词 c# 线程结束时执行 c# kb mb 图片 c# 替换第几位字符 c#项目决定成败 c# 与matlab c# xml缩进 c#传感器基础 c#操作wps c# md5使用方法 c# 引用父窗口的组件