编了一个冒泡排序,不知道问题出哪了,最后输出的顺序没变 3C

#include
void bulsort(int a[]);
void main()
{
int ar[10];
printf("please input ten numbers;\n");
for(int i=0;i<10;i++)
scanf("%d",&ar[i]);
printf("the original order is\n");
for(i=0;i<10;i++)
printf("%4d",ar[i]);
printf("\n");
bulsort(ar);
printf("the final order is\n");
for(i=0;i<10;i++)
printf("%4d",ar[i]);
printf("\n");

}
void bulsort(int ar[])
{
int lon=sizeof(ar)/sizeof(int),tem,i;
for(int j=1;j {
for(i=0;i {
if(ar[i]>ar[i+1])
{
tem=ar[i];
ar[i]=ar[i+1];
ar[i+1]=tem;
}
}
}

}

6个回答

你这方法里的两个for循环怎么看着有点迷,,lon变量也没见你用啊。。。

关键地方代码不全呢

for(int j=1;j {
for(i=0;i {

##for循环嵌套那块没显示全
##可以参考下面的代码

void Print(int* arr, size_t n)
{
for (size_t i = 0; i < n; ++i)
{
cout << arr[i] << " ";
}
cout << endl;
}

//冒泡排序的优化版本
void BubbleSort(int* arr, size_t n)
{
bool flag = true;
//进行n-1次的外循环
for (size_t i = 0; i < n - 1; i++)
{
//每次循环比较n-i-1次
for (size_t j = 0; j < n - i - 1; j++)
{
if (arr[j] > arr[j + 1])
{
swap(arr[j], arr[j + 1]);
//更改标记,用于判断是否有序
flag = false;
}
}
//表示已经有序,直接返回
if (false == true)
return;
}
}

void TestBubbleSort()
{
int arr[10] = { 1, 3, 5, 7, 9, 2, 4, 6, 8, 0 };
BubbleSort(arr, 10);
cout << "冒泡排序:" << endl;
Print(arr, 10);
}

复制出错了,抱歉问题已解决,计算lon出错了。

for(int j=1;j<lon;j++){

for(i=0;i<j;i++){

}

}

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
一个简单的问题,不知道哪出错了
以前都是做java的,没碰到过这种问题,就是一般c++中声明定义放.h中,实现在.cpp。但是我自己做了如下实验却不行rnrntmp.h:rnclass tstClsrnrn public:rn void myDisplay();rnrnrntmp.cpp:rn#include "tmp.h"rnrnvoid tstCls::myDisplay()rnrn cout<<"asdadasd"<
不知道哪出错了
[color=#FF0000]JS:[/color]rnrnString.prototype.format = function() rn var s = this; rn for (var i=0,j=arguments.length; i 2)?arguments[2]:365,rn path = (arguments.length > 3)?arguments[3]:"/";rn with(new Date())rn setDate(getDate()+days);rn days=toUTCString();rn rn document.cookie = "0=1;expires=2;path=3".format(name, value, days, path);rn ,rn Get : function ()rn var returnValue=document.cookie.match(new RegExp("[\b\^;]?" + arguments[0] + "=([^;]*)(?=;|\b|$)","i"));rn return returnValue?unescape(returnValue[1]):returnValue;rn ,rn Delete : function ()rn var name=arguments[0];rn document.cookie = name + "=1 ; expires=Fri, 31 Dec 1900 23:59:59 GMT;";rn rnrnrnvar stTransform = function(s2t)rn var s="万与.......";rn var t="萬與.......";rn s2t = !!s2t || false;rn Cookie.Set("l",s2t?"t":"s");rn var stt = function(str)rn var r = "",i,j,k,c;rn for (i=0,j=str.length; i-1)rn return;rn if(o.title)rn o.title = stt(o.title);rn if(o.alt)rn o.alt = stt(o.alt);rn if(o.tagName && o.type && o.tagName.toUpperCase()=="INPUT" && ",button,submit,reset,".indexOf(o.type.toLowerCase())>-1)rn o.value = stt(o.value);rn for (var i=0,j=o.childNodes.length; i繁体rn[color=#FF0000]rn问题是只能变为繁体,无法变回到简体[/color]
不知道哪出错了?
用结构实现对学生的管理rn#includern#includern#includern#includernstruct Studentrnrn int sid;rn std::string name;rn double score;rn int rank;rn;rnviod printInfo( const Student & s)rnstd::cout<b.score;rnrnvoid put(int &i,char*s="",double &d)rnstd::cout<<"请分别输入学号,姓名,成绩"<>i>>s>>d;rnid=i;rnstrcpy(name,s);rnscore=d;rnrnint main()rnrn int N=5;rn Student s[];rn std::listls;rn for (i=0;i!=n;++i)rn ls.push_back(s[i]);rn ls.sort( compByScore);rn typedef std::list::itrator StudIter;rn for ( StudIter iter=ls.begin();iter!=ls.end();++iter)rn iter->rank=std::distance(ls.begin(),iter)+1;rn std::cout<<"after sort:"< pr;rn for(StudIter iter=ls.begin();iter!=ls.end();++iter)rn rn pr=std::equal_range(iter,ls.end(),*iter,compByScore);rn for(StudIter iter2=pr.first;iter2!=pr.second;++iter2)rn iter2->rank=iter->rank;rn rn std::cout<<"after reRank:"<
不知道哪出錯了!
private void btn_InsertOrUpdate_Click(object sender, System.EventArgs e)rn rnrn cn = bb.GetOldDBConnction();rn OleDbDataAdapter adapter = new OleDbDataAdapter("select * from jobtable",cn);rn OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);rn DataSet data = new DataSet();rn adapter.Fill(data,"jobtable");rn rn //OleDbDataAdapter Adapter = (System.Data.OleDb.OleDbDataAdapter)table.ExtendedProperties["test"];rn rn foreach(DataRow row in data.Tables["jobtable"].Rows)rn rn if(row["id"].ToString().Equals("1"))rn row["Inetval"] = 11;rn rn DataRow Row = data.Tables[0].NewRow();rnrn Row["RunTime"] = DateTime.Now;rn Row["RunNextTime"] = DateTime.Now.AddMinutes(11);rn Row["Inetval"] = 11;rn rn data.Tables[0].Rows.Add(Row);rn rn cn.Open();rnrn //OleDbDataAdapter Adapter = new OleDbDataAdapter();rn tryrn rn int i = adapter.Update(data,data.Tables[0].TableName);rn rn rn catch(Exception ex)rn rn throw new Exception(ex.Message);rn rn finallyrn rn cn.Close();rn rn rn rn這是我今天無聊寫的一個小測試用例,結果老是報一個錯誤:rnrnex.Message: "对于不返回任何键列信息的 SelectCommand 不支持 UpdateCommand 的动态 SQL 生成。"rnrn請達人幫個忙,解釋一下!謝謝!
一个题目,不知道哪出错了,见鬼!!!
http://acm.tju.edu.cn/toj/showp2819.htmlrnrnrnrn以下是我写的代码,用提供的数据验算没有错,但是提交的时候就wa,麻烦高手指点指点!!!!rnrnrnrn#includernrnusing namespace std;rnrnint path[1001][1001];rnint main()rnrn int i,j,k,h;rn rn int n;rn cin>>n;rn rn int S,T;rn int N,M;rn for(i=1;i<=n;i++)rn rn rn rn cin>>N>>M;rn for(k=1;k<=1000;k++)rn rn for(j=1;j<=1000;j++)rn rn path[k][j]=-1;rn rn rn rn cin>>S>>T;rn for(j=1;j<=M;j++)rn rn int a,b,length;rn cin>>a>>b>>length;rn path[a][b]=length;rn path[b][a]=length;rn rn for(h=1;h<=N;h++)rn rn if(h==S||h==T) continue;rn if(path[S][h]!=-1&&path[h][T]!=-1&&(path[S][h]+path[h][T]
一个简单的问题~~不知道哪出错了!很乱啊
public class Random rnrn int i = 1;rnrn int num[] = null;rnrn int temp;rnrn boolean log = true;rnrn public static void main(String agrs[]) rn Random a;rn a = new Random();rn System.out.println(a.setemp());rn rnrn public int setemp() rn int temp = (int) (Math.random() * 37 + 1);rn while (true) rnrn if (i <= 6) rn num[i] = temp;rn i ++;rn log = false;rn else rn for (int count = 0; count < num.length; count++) rn if (num[count] == temp) rn i = 1;rn log = false;rn setemp();rnrn rn rn rn num = null;rn return temp;rn rn rnrnrn
一个数组复制的输出的顺序问题。
public class copyArn public static void main(String args[])rn int myArray[]=1,2,3,4,5,6,7,8,9,0;rn int anotherArray[]=4,3,2,1;rn System.arraycopy(anotherArray,0,myArray,0,anotherArray.length);rn for(int i : myArray)rn System.out.println(myArray[i]);//最后结果输出 5,1,2,3,6,7,8,9,0,4 为什么出现这种排列,这样写有没有意义?rn 改为System.out.println(i);正常输出。4,3,2,1,5,6,7,8,9,0rn rn rnrn
请教一个 输出顺序 问题
请先看以下代码:rnrn#includernrn#includernrnusing namespace std;rnrnvoid main()rnrn int a = 1;rnrn cout <
模糊PID不知道哪出错了-Desktop.zip
模糊PID不知道哪出错了-Desktop.zip 请教大神帮忙给看看
猴子选大王 不知道哪出错了
//单链表类型及其基本操作函数的定义rn#define OK 1rn#define ERROR 0rn#define OVERFLOW -2rn#define TRUE 1rn#define FALSE 0rntypedef int Status;rn#define OVERFLOW -2rn#define TRUE 1rn#include rn#include rn#include rntypedef int LElemType;rntypedef struct Lnodern LElemType data;rn struct Lnode *next;rn *LinkedList; //LinkedList为单链表类型rnrnvoid CreatList_l(LinkedList &L, int n) //正序创建单链表rn LinkedList p,q;rn int i;rn L=q=(LinkedList)malloc(sizeof(struct Lnode));rn L->data=1; rn for(i=2;i<=n;i++)rn rn q->next=(LinkedList)malloc(sizeof(struct Lnode));rn q->data=i; rn q=q->next;rn rn q->next=L;rnrnrn//循环单链表类型及其基本操作函数的定义rnLElemType Count(LinkedList &L,int m,int n)rnrn int i,j;rn LinkedList p,q;rn p=L;rn q=p->next;rn for(j=1;j<=m-1;j++)rn rn for(i=1;i<=n-2;i++)rn rn p=p->next;rn q=q->next;rn rn p->next=q->next;rn p=q->next;rn free(q);rn q=p->next; rn rn return(p->data); rn rnint main()rn rn int n,m;rn int king; rn LinkedList L;rn LElemType data;rn printf("请输入猴子的数目m:"); scanf("%d",&m);rn printf("输入整数n:"); scanf("%d",&n);rn CreatList_l(L,m);rn king=Count(L,m,n);rn printf("猴子大王是:%d!\n",king);rn system("pause");rn return 0;rnrnrnrnrn测试的时候 输入m = 3 ;n = 2rn会出现溢出rn应该在哪个地方怎么修改rn请高人指点
jsp页面出现乱码,不知道哪出错了?
<%@ page language="java" contentType="text/html; charset=GB18030"rn pageEncoding="GB18030"%>rn<%@ page import="com.weiweiqin.*" %> rn<%@ include file="_sessioncheck.jsp" %> rn <% rn request.setCharacterEncoding("GB18030");rn String name=request.getParameter("name");rn out.println(name);//name出现乱码rn %>rnrnrnrn rn Insert title herernrnrn rn //输入框rnrnrnrnrnrn在输入框中输入“你好”rnString name=request.getParameter("name");rnout.println(name);//name出现乱码且输出为ÄãºÃ rnrnrn
数组倒置的递归算法 不知道哪出错了
public class ReverseArray n public static void main(String[] args) n //定义数组n int a[] = 2,3,4,5,6;n n reverse(a,0,a.length-1);n //遍历输出n for(int i = 0;i < a.length;i++) n System.out.print(a[i]);n n n //做递归n public static void reverse(int a[],int i,int j) n if(j > i) n Swap(a,a[i],a[j]);n reverse(a,i+1,j-1);n n n //数组中两个数交换n private static void Swap(int a[],int l,int k) n // TODO Auto-generated method stubn int temp = a[l];n a[l] = a[k];n a[k] = temp;n n nnn输出 数组越界 望大家教教
急死了不知道是哪出错了...
我用的是ACCESS数据库3张表分别是Employe,Department,Comany ,vs2005在做个员工管理的系统第一次用,看Scott Mitchell的ASP.NET2.0数据指南这个书,在2005里面创建强类型的DataSet和Table Adapterrn写上了个SQL语句rnrnSELECT [Employe_ID], [Employe_Name], [Department_ID], [Employe_Position], rn [Employe_Email], [Employe_Mobile], [Employe_Phone], [Employe__QQ], rn [Employe_MSN], [Employe_State],rn (SELECT Department_Namern FROM Departmentrn WHERE Department.Department_ID = Employe.Department_ID) rn AS Department_NamernFROM Employern提示说SELECT 子句错误: “SELECT”附近的表达式。rnSELECT 子句错误: “FROM”附近的表达式。rn缺少 FROM 子句。rn无法分析查询文本。rnrn我要是在在下面加个SELECT [Employe_ID], [Employe_Name], [Department_ID], [Employe_Position], rn [Employe_Email], [Employe_Mobile], [Employe_Phone], [Employe__QQ], rn [Employe_MSN], [Employe_State],rn (SELECT Department_Namern FROM Departmentrn WHERE Department.Department_ID = Employe.Department_ID) rn AS Department_NamernFROM Employernwhere Department_ID=@Department_IDrn他就会说至少有一个变量未被指定值rnrnrn请问这是怎么回事啊...,,,,,我急.......急死了rn
问题出哪了?
#include rn#include rn#include rnvoid main()rnrn FILE *fp;rn char str[3][10],temp[10];rn int i,j,k,n;rn printf("Enter string:\n");rn for(i=0;i0)rn k=j;rn if(k!=i)rn strcpy(temp,str[i]);rn strcpy(tstr[i],str[k]);rn strcpy(str[k],temp);rn rn rn if(fp=fopen("D:\\cc\\temp\\string.dat","w")==NULL)rn rn printf("can't open file!\n");rn exit (0);rn rn printf("\nThe new sequence:\n");rn for(i=0;i
哪出的问题呢?
rn题目: 用链表表示多项式,并且实现求两多项式的和; 例如:rn 3x^4 -6x^2 +5x - 10 //多项式1rn+ 2x^3 +6x^2 -x +1 // 多项式2rn=3x^4 +2x^3 -4x +1 //多项式3rnrn程序中: 输入 4 3 2 -6 1 5 0 -10 //代表多项式1rn 3 2 2 6 1 -1 0 1 //代表多项式2rn rn 输出 4 3 3 2 1 4 0 -9 //代表多项式3rnrn下面是我花一天憋出来的.. 本渣渣刚上完大一,实在是水,程序就是运行出错,求大神解释纠正!rnrnrnrnrnrn[code=c]#includernusing namespace std;rnrnstruct DXSrn int ZS;rn int XS;rn int BZF; //标志位rn DXS *next;rn;rnint main(void)rn DXS *Flist, *Slist, *Fhead,rn *Shead, *Ftail, *Stail, *a, *b,*c,*d,rn *Thead, *Tlist;rn Fhead=Ftail=NULL;rn while(1)rn rn Flist=new DXS;rn cin>>Flist->ZS>>Flist->XS;rn rn Flist->next=NULL;rn if(Ftail==NULL)rn Fhead=Ftail=Flist;rn else Ftail->next=Flist;rn Ftail=Flist; rn if(Flist->ZS==0)rn break; //结束语句rn //建立第一个链表rn Stail=Shead=NULL;rn while(1)rn rn Slist=new DXS;rnrn cin>>Slist->ZS>>Slist->XS;rn rn Slist->next=NULL;rnrn if(Stail==NULL)rn Shead=Slist=Stail;rn else Stail->next=Slist;rn Stail=Slist; rn if(Slist->ZS==0)rn break; //结束语句rn //建立第二个链表rn rn for(a=Fhead;a!=NULL;a=a->next) //把相等指数的项相加到第二个链表rn a->BZF=0;rn for(b=Shead;b!=NULL;b=b->next)rn if(a->ZS=b->ZS)rn b->XS+=a->XS;rn a->BZF=1; //有相等指数时,标志一下rn rn rn rn for(a=Fhead;a!=NULL;a=a->next) //将指数不相等的项插入第二个链表后rn if(a->BZF==0)rn Stail->next=a;rn Stail=a;rn Stail->next=NULL;rn rn rn Tlist=NULL;rn Thead=new DXS;rn Thead->next=Shead;rn while(Thead->next!=Tlist) //冒泡排序rn b=Thead;rn c=b->next;rn while(c!=Tlist)rn if(c->next==NULL) break;rn else if(b->next->ZSnext->ZS) //交换两结点rn d=c->next;rn b->next=c->next;rn c->next=c->next->next;rn b->next->next=c;rn c=d; //这个地方不是很确定rn rn b=b->next;rn c=c->next;rn rn Tlist=b;rn rn cout<<'\n';rn for(Thead=Tlist;Thead!=NULL;Thead=Thead->next)rn if(Thead->XS!=0)rn cout<ZS<<" "<XS;rn rn return 0;[code=c][/code]rn[/code]rnrn程序可以输入,但提示出错
冒泡排序 输出有些问题
#includern#includernvoid bubble_sort(int array[],int n);rnint main()rnrn int n,*a,i;rn printf("n=");rn scanf("%d\n",&n);rn a=malloc(sizeof(int)*n);rn printf("\n");rn for(i=0;iarray[j+1])rn rn temp=array[j];rn array[j]=array[j+1];rn array[j+1]=temp;rn flag=0;rn rn rn if(1==flag)rn break;rn rnrn这是我写的代码,为什么输出会是a[0]=a[1]=... ?
tomcat问题,不知道问题出哪了,怎么解决呢
六月 01, 2012 3:02:04 下午 org.apache.catalina.core.AprLifecycleListener initrn信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk1.7.0_02/bin/../jre/bin/client;C:/Program Files/Java/jdk1.7.0_02/bin/../jre/bin;C:/Program Files/Java/jdk1.7.0_02/bin/../jre/lib/i386;C:\Program Files\Java\jdk1.7.0_02\bin;C:\Program Files\Java\jdk1.6.0_30\bin;D:\TDDOWNLOAD\eclipse\eclipse;;.rn六月 01, 2012 3:02:04 下午 org.apache.coyote.http11.Http11BaseProtocol initrn信息: Initializing Coyote HTTP/1.1 on http-8080rn六月 01, 2012 3:02:04 下午 org.apache.catalina.startup.Catalina loadrn信息: Initialization processed in 484 msrn六月 01, 2012 3:02:04 下午 org.apache.catalina.core.StandardService startrn信息: Starting service Catalinarn六月 01, 2012 3:02:04 下午 org.apache.catalina.core.StandardEngine startrn信息: Starting Servlet Engine: Apache Tomcat/5.5.35rn六月 01, 2012 3:02:04 下午 org.apache.catalina.core.StandardHost startrn信息: XML validation disabledrn六月 01, 2012 3:02:04 下午 org.apache.catalina.loader.WebappClassLoader validateJarFilern信息: validateJarFile(E:\lei\SevletDemo\WebRoot\WEB-INF\lib\javaee.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.classrn六月 01, 2012 3:02:04 下午 org.apache.tomcat.util.digester.Digester endElementrn严重: End event threw exceptionrnjava.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:930)rn at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:579)rn at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)rn at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1058)rn at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)rn at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)rn at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)rn at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)rn at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562)rn at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:348)rn at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1053)rn at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4184)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:448)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)rnCaused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name Myservletrn at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2354)rn at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2334)rn ... 37 morernrn六月 01, 2012 3:02:04 下午 org.apache.catalina.startup.ContextConfig applicationWebConfigrn严重: Parse error in application web.xml file at jndi:/localhost/ServletDemo/WEB-INF/web.xmlrnorg.xml.sax.SAXParseException; systemId: jndi:/localhost/ServletDemo/WEB-INF/web.xml; lineNumber: 16; columnNumber: 20; Error at (16, 20: Servlet mapping specifies an unknown servlet name Myservletrn at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2726)rn at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2752)rn at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1061)rn at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)rn at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)rn at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)rn at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)rn at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1562)rn at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:348)rn at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1053)rn at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4184)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:448)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:552)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)rnCaused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name Myservletrn at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2354)rn at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:2334)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUtils.java:930)rn at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:579)rn at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)rn at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1058)rn ... 29 morernrn六月 01, 2012 3:02:04 下午 org.apache.catalina.startup.ContextConfig applicationWebConfigrn严重: Occurred at line 16 column 20rn六月 01, 2012 3:02:04 下午 org.apache.catalina.startup.ContextConfig startrn严重: Marking this application unavailable due to previous error(s)rn六月 01, 2012 3:02:04 下午 org.apache.catalina.core.StandardContext startrn严重: Error getConfiguredrn六月 01, 2012 3:02:04 下午 org.apache.catalina.core.StandardContext startrn严重: Context [/ServletDemo] startup failed due to previous errorsrn六月 01, 2012 3:02:06 下午 org.apache.catalina.core.ApplicationContext logrn信息: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]rn
很简单的一个关于内存分配的代码,不知道哪出错了
[code=C/C++][/code]#include"stdafx.h"rn#includern#includern#includern#define MAX 50rnrnint main(void)rnrn int *p;rn int j;rn p=(int *)malloc(MAX * sizeof(int));rn if( !p) printf("分配内存出错\n");exit(-1);rn puts("给元素赋值\n");rn for(int i=0;i
不知道问题出在哪?
#include rn#include rn#include rn#include rnrnusing namespace std;rnusing std::string;rnusing std::vector;rnusing std::list;rnrnint main()rnrnrn list slist;rn slist.push_back('a');rn slist.push_back('b');rn slist.push_back('c');rnrn vector vect(slist.begin(),slist.end());rn vector::iterator iter = vect.begin();rn while(iter != vect.end())rn rn cout<<*iter++<
不知道那里出的问题?
我做了个b/s结构的系统,登录界面输入用户名与密码后,进入主页面,在.net中运行时,进入主页面后将不能再回退到登录页面,这是对头的,可是打开IE浏览器访问时,进入主页面后居然可以回退到登录页面,不晓得什么地方有问题,请大家帮忙想想。
不知道问题出在哪
在oracle中表里一字段为varchar2(100)里面存储的内容为一段话,其中有回车换行的,但用rs.getString取出来后放在javaBean中的String 类型 的属性中,再让这个值给jsp 页面中html元素rn标记的value,显示后却没有了回车换行,问题出在哪?
一个insert的问题,不知道错哪了!
rn<%rnaddsql="insert into user(username,userpass,company,contname,email,homepage,tel,fax,code,prov,city,address,content) values('"&request("username")&"','"&request("userpass")&"','"&request("company")&"','"&request("contname")&"','"&request("email")&"','"&request("homepage")&"','"&request("tel")&"','"&request("fax")&"','"&request("code")&"','"&request("prov")&"','"&request("city")&"','"&request("address")&"','"&request("content")&"')"rncnn.execute addsqlrnresponse.Write "注册成功"rn%>rnrn大家帮我看看,这是怎么回事,总是说INSERT INTO 语句的语法错误。
static 输出顺序的问题
以下程序rnclass B rnrn B(int marker) rn rn System.out.println("B(" + marker + ")");rn rn void f(int marker)rn rn System.out.println("f(" + marker + ")");rn rnrnclass T rnrn static B b1;rn static //1rn rn b1 = new B(1);rn rn rn static B b2 = new B(2); //2rn T() //3 //4rn rn System.out.println("T()");rn b2.f(1);rn rn void f2(int marker) rn rn System.out.println("f2(" + marker + ")");rn rn rnrnrnclass Testrn rn public static void main(String[] args)rn rn System.out.println("Before");rn new T(); //4rn System.out.println("After");rn t.f2(1); //5rn rn static T t = new T();rnrn的输出结果为什么是rnB(1)rnB(2)rnT()rnf(1)rnbeforernT()rnT(1)rnafterrnf2(1)
setTimeout顺序输出的问题
JS是一个单线程程序的解释器,setTimeout本质是隔多长时间将任务添加到任务队列中。//输出5,5,5,5 for (var i = 1; i < 5; i++) { setTimeout(function timer() { console.log(i); }, 1000); }由于JS的只有函数作用域,所以当1秒之后,所有的函数的内部变量都指向了全局变量i,
求助。C写的单链表 ,输出最后总会带一个-842150451,查了好久也不知道错哪
#include "iostream"rn#include "string"rnrnusing std::cin;rnusing std::cout;rnusing std::endl;rn#define NULL 0rnrntypedef struct Nodernrn int data;rn struct Node *next;rnNode;rntypedef struct Node *LinkList;rnrnLinkList CreatListHead(LinkList *L,int n)rnrn int i=0,temp=0;rn LinkList p;rn (*L)=(LinkList)malloc(sizeof(Node));rn (*L)->next=NULL;rn for(i=0;i>temp;rn p->data=temp;rn p->next=(*L)->next;rn (*L)->next=p;rn rn return *L;rnrnrnint main()rnrn LinkList L,p;rn p=CreatListHead(&L,10);rn rn while(p!=NULL)rn rn rn cout<data<<" ";rn p=p->next;rn rn rn
线程顺序输出的问题
这个小程序写了三个线程是按照我的意愿来输出的,其中要利用lock锁与condition_t2.signal();
Console的输出顺序问题
Question 120rnGiven: rn1. public class Threads2 implements Runnable rn2. rn3. public void nun() rn4. System.out.println(!±run.!±)rn5. throw new RuntimeException(!±Problem!±)rn6. rn7. public static void main(String[] args) rn8. Thread t = new Thread(new Threads2()); rn9. t.start(); rn10. System.out.println(!±End of method.!±)rn11. rn12. rnWhich two can be results? (Choose two.) rnA. java.lang.RuntimeException: Problem rnB. run. rn java.lang.RuntimeException: Problem rnC. End of method. rn java.lang.RuntimeException: Problem rnD. End of method. rn run. rn java.lang.RuntimeException: Problem rnE. run. rn java.lang.RuntimeException: Problem rn End of method. rnrnrnAnswer: DErn为什么run, java.lang.RuntimeException: Problem 和End of method,它们的顺序会不定呢???谢谢…rn
Ajax 图片转换问题!!不知道哪出错了!求助!!!
我照着网上的一个Ajax实现页面转换的例子做的,但是一直没有效果,不知道哪出错的,高手帮我看看!急用!rn这是前台显示:rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn //显示图片的地方rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrn后台:rnusing System;rnusing System.Data;rnusing System.Configuration;rnusing System.Collections;rnusing System.Web;rnusing System.Web.Security;rnusing System.Web.UI;rnusing System.Web.UI.WebControls;rnusing System.Web.UI.WebControls.WebParts;rnusing System.Web.UI.HtmlControls;rnusing System.IO;rnnamespace CheckMsrnrn public partial class CheckMission : System.Web.UI.Pagern rn DAL.OperSql opsl = new DAL.OperSql();rn protected void Page_Load(object sender, EventArgs e)rn rn rn rnrn public DataSet GetPhotoName(string PicID)rn rn PicID = "20000048";rn string sql = "select 图片文件名称 from 图片表 where 图片编号='" + PicID + "'[color=#FF0000]";//确定取出文件名了[/color] rnDataSet dsPicName= opsl.GetTable(sql, "图片表");rn return dsPicName;rn rn protected void Button1_Click(object sender, EventArgs e)rn rn Button1.Attributes.Add("onclick", "javascript:return LoadPhoto()");;rn rnrnrnrn不知道是哪的问题,百分求助!
有关 FILE* 函数的一些问题(自己编写的,不知道问题出哪了)
以下是我写的一段函数代码:rnFILE *MH_fileOpenWithJudge(const char *nameOfFile, const char *mode, FILE * streamInput)rnrn if ((streamInput = fopen(nameOfFile, mode)) == NULL)rn rn fprintf(stderr, "\nWARNING: I can't creat file \"%s\"", nameOfFile);rn exit(EXIT_FAILURE);rn rn elsern rn printf("\nATTENTION: The creation of the fail \"%s\" is SUCCESS.\n", nameOfFile);rn rnrn return streamInput;rnrn不知道问题出哪了,希望得到指教,谢谢
程序不知道哪出的问题,谁帮忙看下,谢谢
# include rnint main()rnchar qu[56][ ],an[56][ ];rn int go[56][2],i,j,h;rn qu[56][ ]=1 有某种运动是你特别喜欢的,2 觉得自己是个野蛮女友,3 喜欢走在流行的前端,4 曾经有过一脚踏多船的经历,5 喜欢咖啡胜过可可,6 热衷于社团,7 觉得同居比结婚好,8 没有特别支持的政党,9 如果你对你的另一半已经没有感觉你会,10如果你看见你的男友or女友跟异性走在一块你会,11喜欢蓝色多过粉红色,12你是,13 比较喜欢哪种大众运输工具,14 比较不喜欢被骂,15 外出逛街装扮通常是,16 你的球鞋多过休闲鞋,17 喜欢打篮球,18 早上起床是会折好棉被,19 喜欢Energy多过5566,20 打死也不原买盗版,21 在学校里是所谓的乖宝宝,22 喜欢西方电影多过国片,23 喜欢娱乐新闻多过政治新闻,24 喜欢大电话聊天,25 手机电话薄中的异性多过同性,26 接到打错电话会,27 目前有心仪的女孩,28 被人误会时会,29 喜欢全家多过7-11,30 相信星座这回事,31 有偷偷诅咒过别人,32 到KTV时麦克风大多时候都不在你手上,33 受不了噪音,34 现在背出好朋友的手机号码,35 手机至少一年换一次,36 讨厌在路边摊吃饭,37 找不到男(女)友时会发疯,38 若全世界异性瞬间消失,你会,39 一个人走在街上看到成双成对的情侣时会有上去踢飞他们的冲动,40 喜欢上网多过看电视,41 认为自己还挺阔气,42 看到前一任男友会打招呼,43 认为暧昧是一种幸福,44 会跟第一次见面的异性单独去看电影,45 有很喜欢很喜欢一个艺人or明星过,46 现在想到初中时的头会觉得很蠢,47 小时侯比现在还胖,48 很喜欢自己的星座,49 迷路会到警察局找警察杯杯,50 决不花一分钱在保养脚趾上,51 想回到过去,52 会说梦话,53 在公交上故意装睡,54 曾在电话中聊天超过过一小时,55有定期买杂志的习惯,56 有心仪的异性不会跟任何人说;rn an[68][ ]=1 有 2 没有,1 是 2 不是,1 是 2 不是,1 有 2 没有,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 有 2 没有,1 维持现状 2 离婚,1 装做没看见,快速走过 2 走上前问个究竟,1 是 2 不是,1 右撇子 2 左撇子,1 捷运,公交 2 出租车,1 八婆(自大狂) 2 男人婆(娘娘腔),1 运动型 2 淑女型,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 跟他说你打错了后直接挂断 2 跟他说你打错了后顺便哈拉一下,1 是 2 不是,1 死命澄清自己的清白 2 让时间澄清你清白,不多做解释,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 试着跟同性交往看看 2 宁愿自杀也不愿成为GAY,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是, 1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,1 是 2 不是,巨蟹,射手,魔蝎,水瓶,处女,金牛,天蝎,双鱼,狮子,牧羊,天秤,双子;rn go[56][2]=6,9,5,10,8,11,7,12,18,14,17,13,20,16,15,19,17,13,14,18,19,15,16,20,27,23,22,28,21,25,24,26,23,27,28,22,25,21,26,24,35,34,30,33,29,36,32,34,31,35,34,32,36,29,30,33,37,41,39,42,38,43,44,40,39,42,40,44,38,43,37,41,45,49,47,51,46,50,52,48,49,45,50,46,51,47,48,52,49,54,50,55,51,53,52,56,54,57,55,58,59,53,60,56,61,62,63,64,65,66,67,68;rn printf("请从下列选项中选出你的星座并输入其标号:1 水象星座(巨蟹,天蝎,双鱼) 2 火象星座(牧羊,狮子,射手) 3 土象星座(金牛,处女,魔蝎) 4 风象星座(双子,天秤,水瓶)\n请在此输入您的标号:");rn scanf("%d",&i);rn while(h<=100)rn printf("%s\n%s\n请输入答案标号:\n",qu[i-1][],an[i-1][]);rn scanf("%d",&j);rn i=go[i-1][j-1];rn rn printf("你属于%s座",an[i-1][]);rn return 0;rnrnrn下面是错误信息 我看不懂 谁帮忙看下rn rnE:\C\心理测试\复件 Text1.c(3) : error C2087: '' : missing subscriptrnE:\C\心理测试\复件 Text1.c(3) : error C2087: '' : missing subscriptrnE:\C\心理测试\复件 Text1.c(5) : error C2059: syntax error : ']'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd3'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd0'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb3'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd6'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd6'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xcb'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb6'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xaf'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xca'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc7'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xe3'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xcc'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd8'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb1'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xf0'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xcf'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb2'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbb'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb6'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb5'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbe'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xf5'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb5'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc3'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd7'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbc'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xba'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xca'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc7'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb8'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xf6'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd2'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb0'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc2'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xf9'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc5'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xae'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd3'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd1'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xcf'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb2'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbb'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb6'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd7'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xdf'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xda'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc1'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xf7'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd0'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd0'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb5'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc7'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb0'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb6'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xcb'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xf8'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbe'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xad'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd3'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd0'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb9'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xfd'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xd2'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbb'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbd'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc5'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xcc'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xa4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb6'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xe0'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xac'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb5'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbe'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xad'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc0'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xfa'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xcf'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb2'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbb'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb6'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xbf'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xa7'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb7'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xc8'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xca'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xa4'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xb9'rnE:\C\心理测试\复件 Text1.c(5) : error C2018: unknown character '0xfd'rnE:\C\心理测试\复件 Text1.c(5) : fatal error C1003: error count exceeds 100; stopping compilationrnError executing cl.exe.rnrn
帮我看看这段练习的代码,GUI的 不知道问题出哪了。
可以通过编译 但没有动作rnrnMouseEven事件一个都没有完成,不知道为什么。rnrn[code=Java]package Swing2;rnrnimport java.awt.*;rnimport java.awt.event.*;rnimport javax.swing.*;rnrnpublic class MouseDemo2 extends MouseAdapterrnrnJFrame f=null;rnJButton b1=null;rnJLabel label=null;rnrnpublic MouseDemo2()rnrnf=new JFrame("MouseDemo2");rnContainer contentPane=f.getContentPane();rncontentPane.setLayout(new GridLayout(2,1));rnb1=new JButton("BUTTON");rnlabel=new JLabel("起始状态,还没哟鼠标事件",JLabel.CENTER);rnb1.addMouseListener(this);rncontentPane.add(b1);rncontentPane.add(label);rnf.pack();rnf.show();rnf.addWindowListener(new WindowAdapter()rnpublic void windowClosing(WindowEvent e)rnSystem.exit(0);rn);rnrnrnpublic void MousePressed(MouseEvent e)rnrnlabel.setText("目前鼠标坐标(X,Y)为:("e.getX()","e.getY()")");rnrnrnpublic void MouseClicked(MouseEvent e)rnrnif (e.getClickCount()==2)rnrnJFrame newf=new JFrame("new window");rnnewf.setSize(400,230);rnnewf.show();rnrnrnrnpublic static void main(String arg[])rnrnnew MouseDemo2();rnrn[/code]
二维数组最后输出问题
倒置的杨辉三角形rn输入rn多组n值,每行一个整数rnrnrn输出rn对应于每一个n值,输出一个倒杨辉三角形rnrn每个杨辉三角形之间用一个空行隔开rnrn每个杨辉三角形的最上面的第一行的第一个数字在第一列,后面的每个数字占据3个字符的宽度rnrn从第二行开始,每一行的最前面加多一个空格,每一行的第一个数字1占据一个字符的宽度,后面的每个数字占据三个字符的宽度rnrnrnrn样例输入rn5rn3rn样例输出rn1 4 6 4 1rn 1 3 3 1rn 1 2 1rn 1 1rn 1rnrn1 2 1rn 1 1rn 1rnrn贴上代码,现在可以倒着输出三角形,但前面的空格不知怎样弄,求解rn[code=objc]public static void main(String[] args) rn // TODO Auto-generated method stubrn Scanner rd=new Scanner(System.in);rn int i,j;rn int n=rd.nextInt();rn int arr[][]=new int[n][];rn for(i=0;ij&&j!=0)rn arr[i][j]=arr[i-1][j-1]+arr[i-1][j];rn rn elsern rn arr[i][j]=1;rn rn rn rn for(i=arr.length-1;i>=0;i--)rn rn for(j=0;j
请教一个linux多线程编程输出顺序问题
[code=c]#include rn#include rn#include rnrn#define THREAD_NUMBER 3rn#define REPEAT_NUMBER 3rn#define DELAY_TIME_LEVELS 10.0rnpthread_mutex_t mutex;rnrnrnvoid *thrd_func(void *arg)rnrn int thrd_num=(int)arg;rn int delay_time=0,count=0;rn int res;rn /*互斥锁上锁*/rn res=pthread_mutex_lock(&mutex);rn if(res)rn rn printf("Thread %d lock failed\n",thrd_num);rn pthread_exit(NULL);rn rn printf("Thread %d is starting\n",thrd_num);rn rn for(count=0;count
请教一个CodeSmith字段输出顺序的问题
刚使用CodeSmith,但发现每次输出字段名的时候都是按字母顺序排序,不是数据库本身字段顺序,如何实现按数据库本身的字段顺序输出呢?rn代码例如:rnrn<%@ Template Language="C#" TargetLanguage="C#" Debug="False" %>rn<%@ Assembly Name="SchemaExplorer" %>rn<%@ Import Namespace="SchemaExplorer" %>rn<%@ Property Name="DBT" Type="SchemaExplorer.TableSchema" Category="Context" %> rnrn<%for(int i = 0; i < DBT.Columns.Count;i++)%><%=DBT.Columns[i].Name %><%if(i < DBT.Columns.Count-1) %>,rn<%%><%%>rnrnrn另外CodeSmith能使用变量吗?就是把比较复杂的属性引用变为某个变量,这样代码看起来简洁些,除了用
无法加载mysql问题出哪了?
重做了系统 (XP)rn重新安装了 APACHE 和 MYSQL rnrn最后安装了 PHP 后 无法连接MYSQLrnrnD:/APACHE2.2rnD:/PHP5rnrnhttpd.conf 增加了 rnLoadModule php5_module "D:/php5/php5apache2_2.dll"rnPHPIniDir "D:\php5\php.ini" rnAddType application/x-httpd-php .phprnrnphp.ini rnextension=php_mssql.dllrnextension=php_mysql.dllrnextension=php_mysqli.dllrnextension_dir ="D:/php5/extensions"rnrnrnlibmysql.dll我已经复制到D:/php5/extensions里了rnrn无法使用mysql模块rn
输出的顺序
我们输出的顺序是:rnrn左到右还是右到左呢?rnrnrn就是我们输出123rnrn是rn123rn→rn还是rn123rn ←?rn
输出顺序
def myfunc(): print(&quot;我是里面那个&quot;) print('我是外面的') myfunc() 输出结果: 我是外面的 我是里面那个 此时你想到了什么?
JavaWeb的问题,不知道错哪了
java.sql.SQLException: Can not issue data manipulation statements with executeQuery().rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)rn at com.mysql.jdbc.Statement.checkForDml(Statement.java:417)rn at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1383)rn at src.com.sdust.dao.ComplainDaoImpl.updateComplain(ComplainDaoImpl.java:51)rn at src.com.sdust.service.ComplainServiceImpl.updateComplain(ComplainServiceImpl.java:21)rn at src.com.sdust.servlet.ComplainServlet.doPost(ComplainServlet.java:69)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)rn at java.lang.Thread.run(Thread.java:619)rnrnrn源代码为public void updateComplain(String type, String id) rn // TODO Auto-generated method stubrnrn Connection conn=null;rn PreparedStatement pstmt=null;rn String sql="update complain set type=? where Id=?";rn rn try rn conn=DbUtils.getConnection();rn pstmt=conn.prepareStatement(sql);rn pstmt.setString(1, type);rn pstmt.setString(2, id);rn pstmt.executeUpdate();rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finallyrn DbUtils.closeResult(rs);rn DbUtils.closeStatement(pstmt);rn DbUtils.closeConnection();rn rn rn
不知道哪出了问题,求解。。
#include "stdio.h"rn#define size 7rnvoid change(int a[],int size);rnvoid print(int a[],int size);rnvoid mian()rnrn int i,score[size];rn printf("please input %d rank:",size);rn for(i=0;i
顺序输出
#include &amp;lt;stdio.h&amp;gt; #include &amp;lt;math.h&amp;gt; int GetFigures(int n) { int court=0; while (n!=0) { n=n/10; court++; } return court; } int main(int n) { scanf(&quot;%d&quot;,&amp;amp;n); int a=GetFigures(n); int m...
相关热词 c#检测非法字符 c#双屏截图 c#中怎么关闭线程 c# 显示服务器上的图片 api嵌入窗口 c# c# 控制网页 c# encrypt c#微信网页版登录 c# login 居中 c# 考试软件