做不下去了,求妖孽大神求圈养

写不下去了,求大神指导!_百度知道
写不下去了,求大神指导!
Scanner input = new Scanner (System.in盘套凛鹤绠瓜陵谭搂砍);
System.out.println(&请输入用户名:&);
String yhm = input.next();
System.out.println(&请输入密码:&);
int mm=input.nextInt();
if(yhm==&青&&&mm==123){
//
就是这里出问题了,If里面yhm应该怎么写啊!
System.out.println(&欢迎你,青!&);
System.out.println(&欢迎你,青!&);
public class Test {public static void main(String[] args) {test1();// test2();// test3();// test4();}private static void test4() {String s1 = &Monday&;String s2 = new String(&Monday&);s2 = s2.intern();if (s1 == s2) {System.out.println(&s1 == s2&);} else {System.out.println(&s1 != s2&);}if (s1.equals(s2)) {System.out.println(&s1 equals s2&);} else {System.out.println(&s1 not equals s2&);}}private static void test3() {String s1 = &Monday&;String s2 = new String(&Monday&);if (s1 == s2) {System.out.println(&s1 == s2&);} else {System.out.println(&s1 != s2&);}if (s1.equals(s2)) {System.out.println(&s1 equals s2&);} else {System.out.println(&s1 not equals s2&);}}priva僖塄零缎绱等琉劝颅滑te static void test2() {String s1 = &Monday&;String s2 = &Monday&;if (s1 == s2) {System.out.println(&s1 == s2&);} else {System.out.println(&s1 != s2&);}}private static void test1() {Scanner input = new Scanner(System.in);System.out.println(&请输入用户名:&);String yhm = input.next();// 和new出来的没什么区别System.out.println(&输出是::& + yhm);System.out.println(&请输入密码:&);int mm = input.nextInt();// if (&青&.equals(yhm) && mm == 123) { // 就是这里出问题了,If里面yhm应该怎么写啊!if (&xx&.equals(yhm) && mm == 123) {// 我用eclipse写的有编码问题,所以用XX代替System.out.println(&欢迎你,青!&);} else {System.out.println(&北京欢迎你!&);}if (&xx& == yhm.intern()) {// 呵呵,我也学到了,根据test4,你自己看吧System.out.println(&是的&);}}}
按默认排序
其他2条回答
用equals方法
if(yhm.equal(&青&)&&mm==123){
就是这里出问题了,If里面yhm应该怎么写啊!
System.out.println(&欢迎你,青!&);
System.out.println(&欢迎你,青!&);
}字符串不能用== 比较。
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁求大神再来给我看看顺序表程序错误吧,再也改正不下去了,累觉不爱。。。_百度知道
求大神再来给我看看顺序表程序错误吧,再也改正不下去了,累觉不爱。。。
#include&iostream&#define LIST_INIT_SIZE 100#define LISTINCREMENTtypedef int Dtypedef struct{ int *
}SqLint ListLength(SqList L);Datatype GetElem(SqList L,int i,int &e);int LocateElem(SqList L,int e,int i);bool ListInsert(SqList &L,int i,int e);bool InitList_Sq(SqList &L);void main(){
SqList LA,LB; int LA_len,LB_ int e,i,j; InitList_Sq(LA); InitList_Sq(LB);
LA_len=ListLength(LA); LB_len=ListLength(LB); for(i=1;i&=LB_i++) {
GetElem(LB,i,e);
if(!LocateElem(LA,e,j))
ListInsert(LA,i,e); }}int ListLength(SqList L){ return L.}Datatype GetElem(SqList L,int i,int &e);{ int *p; if((i&1)||(i&L.length))
cout&&&这个元素不存在&&& p=&(L.elem[i-1]); e=*p; }int LocateElem(SqList L,int e,int i){ for(int i=1;i&=L.i++) {
if(e==&(L.elem[i-1]))
return 0; }}bool ListInsert(SqList &L,int i,int e){
if(L.length&=LIST_INIT_SIZE) {
cout&&&溢出&&&
return 0; } else if((i&1)||(i&L.length+1)) {
cout&&&元素不存在&&&
return 0; } else {
for(j=L.j&=i;j--)
L.elem[j]=L.elem[j-1];
L.elem[i-1]=e;
L.length++;
return 1; }}bool InitList_Sq(SqList &L){ L.elem= (int *) malloc(sizeof(int) * LIST_INIT_SIZE); if(!L.elem)
exit(0); L.length=0; L.listsize= LIST_INIT_SIZE; return 1;}下面是运行出现的错误:--------------------Configuration: 顺序表 - Win32 Debug--------------------Compiling...shunxubiao.cppD:\顺序表\shunxubiao.cpp(44) : error C2447: missing function header (old-style formal list?)D:\顺序表\shunxubiao.cpp(55) : error C2082: redefinition of formal parameter 'i'D:\顺序表\shunxubiao.cpp(57) : error C2446: '==' : no conversion from 'int *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style castD:\顺序表\shunxubiao.cpp(57) : error C2040: '==' : 'int' differs in levels of indirection from 'int *'执行 cl.exe 时出错.顺序表.exe - 1 error(s), 0 warning(s)这些错误具体指的是什么啊,不太明白。。。
提问者采纳
//缺少函数头。D:\顺序表\shunxubiao.cpp(44) : error C2447: missing function header (old-style formal list?)//变量i重定义。D:\顺序表\shunxubiao.cpp(55) : error C2082: redefinition of formal parameter 'i'//不能从int *转变成int型D:\顺序表\shunxubiao.cpp(57) : error C2446: '==' : no conversion from 'int *' to 'int' & & & &This conversion requires a reinterpret_cast, a C-style cast or function-style cast//不同等级的运算,不能使用'=='D:\顺序表\shunxubiao.cpp(57) : error C2040: '==' : 'int' differs in levels of indirection from 'int *'执行 cl.exe 时出错.#include&iostream&using&namespace&#define&LIST_INIT_SIZE&100#define&LISTINCREMENTtypedef&int&Dtypedef&struct{int&*int&int&}SqLint&ListLength(SqList&L);Datatype&GetElem(SqList&L,int&i,int&&e);int&LocateElem(SqList&L,int&e,int&i);bool&ListInsert(SqList&&L,int&i,int&e);bool&InitList_Sq(SqList&&L);void&main(){&&&SqList&LA,LB;int&LA_len,LB_int&e,i,j;InitList_Sq(LA);InitList_Sq(LB);&&&LA_len=ListLength(LA);LB_len=ListLength(LB);for(i=1;i&=LB_i++){GetElem(LB,i,e);if(!LocateElem(LA,e,j))ListInsert(LA,i,e);}}int&ListLength(SqList&L){return&L.}Datatype&GetElem(SqList&L,int&i,int&&e){int&*p;if((i&1)||(i&L.length))cout&&&???????&&&p=&(L.elem[i-1]);e=*p;return&e;}int&LocateElem(SqList&L,int&e,int&i){for(i=1;i&=L.i++){if(e==L.elem[i-1])return&i;else&&return&0;}}bool&ListInsert(SqList&&L,int&i,int&e){int&j;if(L.length&=LIST_INIT_SIZE){cout&&&??&&&return&0;}else&if((i&1)||(i&L.length+1)){cout&&&?????&&&return&0;}else{for(j=L.j&=i;j--)L.elem[j]=L.elem[j-1];L.elem[i-1]=e;L.length++;return&1;}}bool&InitList_Sq(SqList&&L){L.elem=&(int&*)&malloc(sizeof(int)&*&LIST_INIT_SIZE);if(!L.elem)&exit(0);L.length=0;L.listsize=&LIST_INIT_SIZE;return&1;}
我把主函数改了改:& }运行出来的结果也不对啊,LA长度应该是6才对,LA的数据应该是135624,还有j怎么也没输出字数限制只能放图了,麻烦大神了哈~
提问者评价
大神解决下我的追问吧。。。
来自:求助得到的回答
其他类似问题
按默认排序
其他4条回答
首先,这是编译错误,不是运行错误,这二者是不同的概念line&44:&Datatype&GetElem(SqList&L,int&i,int&&e);看到分号没有?这是非法的函数line&55:int&LocateElem(SqList&L,int&e,int&i)line&56:for(int&i=1;i&=L.i++)这里的i被定义了2次line&57:&if(e==&(L.elem[i-1]))常数和指针地址做比较?
我把主函数改了改:& }运行出来的结果也不对啊,LA长度应该是6才对,LA的数据应该是135624,还有j怎么也没输出
我不懂~~~~~~~~~~~~~~~
我不懂~~~~~~~~~~~~~~~
我不懂~~~~~~~~~~~~~~~
程序错误的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁做不下去了!!18.19求大神解答!过程和答案!拜托.._百度知道
提问者采纳
提问者评价
你的回答完美的解决了我的问题,谢谢!
来自:作业帮
其他类似问题
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁高二数列 做到这里写不下去了,感觉题出错了,求大神明鉴_百度知道
提问者采纳
因为这是用Sn求an的问题,首先可以设出An的解析式,再求an2的Sn就可以了…,就是an2的解析式了,又知道Sn就可以求出An的解析式…再将An平方,因为你求出了a1,
需要数字过程吗?
感觉题出错了……
你先用这个方法算一下…如果算不出来,那应该错了…
提问者评价
太给力了,你的回答完美地解决了我的问题,非常感谢!
其他类似问题
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁没剧情的已经看不下去了,跪求波吧大神给几部有剧情的_波多野结衣吧_百度贴吧
关注:448,104贴子:3,739,300
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
图片&273122
没剧情的已经看不下去了,跪求波吧大神给几部有剧情的收藏
登录百度帐号我的游戏推荐游戏
后查看最近玩过的游戏
使用签名档&&
为兴趣而生,贴吧更懂你。或

我要回帖

更多关于 求大神 的文章

 

随机推荐