Java程序出现错误 数组越界 (刚学不久,不知道哪里错了,求大神指导!!!)

public class Score{
public static void main(String[] args){
int[][] score=new int[][]{{88,90,90},{70,60,70},{54,88,50},{60,75,83}};
double ave1[]=new double[4];

for(int i=0;i<4;i++){
   for(int j=0;j<3;i++){
            ave1[i]+=score[i][j];
   }

      System.out.println(ave1[i]/3+" ");
   }

double ave2[]=new double[3];

for(int n=0;n<3;n++){
   for(int m=0;m<4;m++){
        ave2[n]+=score[m][n];
 } 

System.out.println(ave2[n]/4+" ");
   }

}

}

//出现这样的错误 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
at Score.main(Score.java:8)

2个回答

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

看这一句,最后应该是j++,而不是i++

m0_37704564
logyum 谢谢!没想到犯了低级错误,本来C++就没学好。。。
2 年多之前 回复

int j=0;j<3;i++,这里错了,是 j++

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Java程序出现错误 数组越界 (刚学不久,不知道哪里错了,求大神指导!!!)
public class Scoren public static void main(String[] args)n int[][] score=new int[][]88,90,90,70,60,70,54,88,50,60,75,83;n double ave1[]=new double[4];n n for(int i=0;i<4;i++)n for(int j=0;j<3;i++)n ave1[i]+=score[i][j];n n n System.out.println(ave1[i]/3+" ");n n n double ave2[]=new double[3];n n for(int n=0;n<3;n++)n for(int m=0;m<4;m++)n ave2[n]+=score[m][n];n n n System.out.println(ave2[n]/4+" ");n n n n nnnnn//出现这样的错误 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4n at Score.main(Score.java:8)
不知道哪里错了,求指导
创建一个栈,将10、12、14入栈,输出栈顶元素,然后退栈,代码如下 #include const int size=10; class stack {     int stck[size];     int tos; public:     stack(int tos)     {tos=0;};     void push(int ch);     int pop();
java程序不知道哪里错了,求指教
不知道哪里错了,求指教n程序如下:npackage com.Sixping.Ncre;nnimport java.util.*;nnpublic class AbstractClassTest n public static void main(String[] args) n Person[] people=new Person[2];n people[0]=new Employee0("张浩", 50000, 1989, 10, 1);n people[1]=new Student0("李明", "计算机科学");n for(Person p:people)n System.out.println(p.getName()+","+p.getDescription());n n nnnabstract class Personn public Person(String n) n name=n;n n public abstract String getDescription();n public String getName()n return name;n n private String name;nnclass Employee0 extends Personn public Employee0(String n,double s,int year,int mouth ,int day)n super(n);n salary=s;n GregorianCalendar calendar=new GregorianCalendar(year ,mouth-1,day);n hireDay=calendar.getTime();n n public String getDescription() n return String.format("公司雇员,年薪是¥%。2f。", salary);n n private double salary;n private Date hireDay;nnclass Student0 extends Personn public Student0(String n, String m) n super(n);n major=m;n n public String grtDescription() n return "大学生,专业是"+major+"。";n n private String major; nnnn错误信息:nnException in thread "main" java.util.UnknownFormatConversionException: Conversion = '。'n at java.util.Formatter.checkText(Formatter.java:2502)n at java.util.Formatter.parse(Formatter.java:2484)n at java.util.Formatter.format(Formatter.java:2413)n at java.util.Formatter.format(Formatter.java:2366)n at java.lang.String.format(String.java:2770)n at com.Sixping.Ncre.Employee0.getDescription(AbstractClassTest.java:34)n at com.Sixping.Ncre.AbstractClassTest.main(AbstractClassTest.java:11)nnnn
刚学的类与对象的思想(自己整理的)
自己理解的: class 类是有很多的对象组成的,能定义新的数据类型,C++里有一句“万物皆对象”(该对象非彼“对象”)。类这东西就是把C语言的结构体与函数拼接到一起了,能描述一个物体的结构和功能。 一个类,有公共部分(public),私有部分(private),保护部分(protect),公共部分就像人一样是面向公共的,任何的数据都可以访问就像公共的财富,私有部分(private)...
求 指导!!(不知道哪里错了, 各位大神帮帮忙)
#includern#includern#define LEN sizeof(struct Student)rnstruct Studentrn long num;rn float score;rn struct Student * next;rn;rnrnstruct Student *creat()rnrn struct Student * head;rn struct Student *p1, *p2;rn int n=0;rn p1 = p2 = (struct Student *)malloc(LEN);rn scanf("%ld,%f",& p1->num ,& p1->score );rn head = NULL;rn while(p1 ->num != 0)rn rn n+=1;rn if(n == 1) head = p1;rn else p2 -> next = p1;rn p2 = p1;rn p1 = (struct Student *)malloc(LEN);rn scanf("%ld,%f",& p1 ->num ,&p1 ->score );rn rn p2 -> next = NULL;rn return (head);rnrnrnvoid print(struct Student * head)rnrn struct Student *p;rn printf("\nrecords:\n");rn p = head;rn if(head != NULL)rn dorn rn printf("%ld%5.1f\n",p ->num, p ->score);rn p = p ->next;rn rn while (p != NULL);rnrnrnvoid delate(struct Student * head, int n)rnrn struct Student *p;rn int i = 0;rn p = head;rn if(head != NULL)rn dorn rn if(i != 0)rn rn printf("%ld%5.1f\n", p -> num ,p ->score );rn p = p->next ; i++;rn rn else rn rn p = p->next ->next;rn printf("%ld%5.1f\n", p -> num ,p ->score );rn rn rn while(p != NULL);rnrnrnvoid insert(struct Student * head, int n)rnrn struct Student *p,*p1,*p2;rn int i = 0;rn p = head;rn p2= NULL;rn p1 = (struct Student *)malloc(LEN);rn scanf("%ld,%f",& p1->num ,& p1->score );rn if(head != NULL)rn dorn rn if(i != n)rn rn printf("%ld%5.1f",p ->num ,p ->score );rn p = p ->next;rn i++;rn rn else rn rn p2 = p;rn p = p1;rn printf("%ld%5.1f",p ->num ,p ->score );rn p -> next = p2;rn rn rn while (p != NULL);rnrnrnvoid main()rnrn struct Student * head;rn int i,j;rn head = creat();rn print(head);rn printf("输入要删除的行数:");rn scanf("%d",& i);rn delate (head,i);rn printf("输入要插入行数:");rn scanf("%d",&j);rn insert(head,j);rn
【不知道哪里错了,求大神帮忙】
Descriptionrn输入一个字符串,判断其是否是C的合法标识符。rnrnInputrn输入数据包含多个测试实例,数据的第一行是一个整数 n ,表示测试实例的个数,然后是n行输入数据,每行是一个长度不超过50的字符串,判断这个字符串是否一个合法的标识符。rnrn输入的字符串不含C语言关键字。rnrnOutputrn对于每组输入数据,输出一行。如果输入数据是C的合法标识符,则输出 "yes" ,否则,输出 "no"rnrnSample Inputrn3rn12ajfrnfi8x_arnff ai_2rnrnSample Outputrnnornyesrnnornrnrnrn[code=c]#includern#includernint main()rnrn int n,i,t,m,j;rn char a[51];rnwhile(scanf("%d",&n)!=EOF)rn rn getchar();rn for(i=1;i<=n;i++)rn rn m=0;rn rn gets(a);rn t=strlen(a);rn if(('a'<=a[0]&&a[0]<='z')||('A'<=a[0]&&a[0]<='Z')||a[0]=='_')rn m=1;rn for(j=0;j
不知道哪里出错了,求大神解答!!!
定义2个二维整型数组,每个数组元素都>=8个,但个数不能相同,1个数组在定义时初始化元素,另一个数组通过键盘输入元素,分别输出2个数组中的所有元素(要求:按照矩阵格式输出)rnrn```rn#include rnint main()rn rn int a[] = 1,2,3,4,5,6,7,8, b[9];rn int n = 9;rn for (int i = 0; i < n; i++)rn rn scanf("%d", &b[i]);rn rn printf("A数组:rn");rn for (int i = 0; i < 8; i++)rn rn if (i && i % 4 == 0) printf("rn");rn printf("%d ", a[i]);rn rn printf("B数组:");rn for (int i = 0; i < n; i++)rn rn if (i && i % 3 == 0) printf("rn");rn printf("%d ", b[i]);rn rn printf("rn");rn return 0;rnrn```
错误500 不知道代码哪里出错了 求大神解答
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>rn<%@ page import="java.sql.*"%>rnrnrn rn 在线购物rn rn <%rn //装载MySQL5.5的JDBC驱动rn Class.forName("com.mysql.jdbc.Driver").newInstance();rn //建立数据库连接rn String url ="jdbc:mysql://localhost:3306/eshop?user=root&password=123&useUnicode=true&characterEncoding=gb2312";rn Connection conn= DriverManager.getConnection(url);rn //建立一个Statement对象,用于执行SQL语句rn Statement stat = conn.createStatement();rn //执行查询并得到查询结果rn String sql = "select * from show";rn ResultSet rs = stat.executeQuery(sql); rn %> rn rn 在线购物rn rn rn rn 商品缩图 rn 商品摘要rn 在线购买rn rn <%rn String bm,name,price,info,img;rn //将查询结果集中的记录输出到页面上rn while (rs.next())rn //从当前记录中读取各字段的值rn img = rs.getString("SP_PIC").trim();rn bm = rs.getString("SP_NO").trim();rn name = rs.getString("SP_NAME").trim();rn price = rs.getString("SP_PRICE").trim();rn info = rs.getString("SP_INFO").trim();rn rn out.println(" ");rn out.println(" ");rn out.println(" ");rn out.println("商品编号:"+ bm +" ");rn out.println("商品名称:"+ name +" ");rn out.println("商品价格:"+ price +"元 ");rn out.println("商品简介:"+ info +" ");rn out.println("");rn out.println(" 放入购物车");rn out.println("");rn rn %> rn rn rn 查看购物车 rn 清空购物车 rn rnrn这个是我的页面代码 rnrnrnrnrnrnrn下面是我出错的页面rnrnrnrnorg.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 13rnrn10: Class.forName("com.mysql.jdbc.Driver").newInstance();rn11: //建立数据库连接rn12: String url ="jdbc:mysql://localhost:3306/eshop?user=root&password=123&useUnicode=true&characterEncoding=gb2312";rn13: Connection conn= DriverManager.getConnection(url);rn14: //建立一个Statement对象,用于执行SQL语句rn15: Statement stat = conn.createStatement();rn16: //执行查询并得到查询结果rnrnrn求帮助啊。 新手小白 很多东西不会 希望有人可以给我仔细解答rn
哪里错了,求大神!!!!
#includennvoid input(char*s)nnscanf("%s",s);nnvoid output(char*s)nnprintf("%s",s);nnvoid add(char*s1,char*s2,char*s)nnint i,j,k,k1,t=0;nn for(i=0;s1[i];i++);nn for(j=0;s2[j];j++);nn i--,j--;nn k=i>j?i:j;nn k1=k+1;nn s[k1]='\0';nn for(;i>=0&&j>=0;k--)nn nns[k]=s1[i--]+s2[j--]-'0'+t;nnt=s[k]>'9';nnif(t)s[k]-=10;nn nn for(;i>=0;k--)nn nns[k]=s1[i--]+t;nnt=s[k]>'9';nnif(t)s[k]-=10;nn nn for(;j>=0;k--)nn nns[k]=s2[j--]+t;nnt=s[k]>'9';nnif(t)s[k]-=10;nn nn if(t)nn nnfor(;k1>=0;k1--)s[k1+1]=s[k1];nns[0]='1';nn nnnnnnnvoid sub(char*s1,char*s2,char*s)nnint i,j,k,k1,t=0;nn for(i=0;s1[i];i++);nn for(j=0;s2[j];j++);nn i--,j--;nn k=i>j?i:j;nn k1=k+1;nn s[k1]='\0';nn for(;j>=0;k--)nn nns[k]=s1[i--]-s2[j--]+'0'-t;nnt=s[k]<'0';nnif(t)s[k]+=10;nn nn for(;i>=0;k--)nn nns[k]=s1[i--]-t;nnt=s[k]<'0';nnif(t)s[k]+=10;nn nnnnint comp(char*s1,char*s2)nnint i,j;nn for(i=0;s1[i];i++);nn for(j=0;s2[j];j++);nn if(i>j)return 1;nn if(i=0&&s1[i]==s2[i];i++);nn if(s1[i]>s2[i])return 1;nn if(s1[i]
求救大神!!!!!!!!!!!!!!!!!!!!不知道哪里出现错误
[color=#FF0000]题目[/color]用1到9组成3个三位数(每个数字只能用一次),使其中两个数的和等于第三个数rnrnrn要求数组方法,输出所有满足条件的等式(如124 + 659 = 783rn125 + 739 = 864) rn[color=#FF0000]我自己写的[/color]rn[code=java]import java.util.* ;rnpublic class ArrayTest rn public static void main(String[] args)rn int[] arr = new int[9*8*7];rn int i , j , k , x = 0 ;rn for(i = 1 ; i < 10 ; i ++)rn for(j =1 ; j < 10 ; j ++)rn if(j == i)rn continue ;rn rn for(k = 1; k < 10 ; k ++)rn if(k == j||k==i)rn continue ;rn rn arr[x] = 100*i+10*j+k ;rn x ++ ;rn rn rn rn for(int a = 0 ; a <= arr.length ; a ++)rn for(int b = 0 ; b <= arr.length ; b ++)rn for(int c = 0 ; c <= arr.length ; c ++)rn if((arr[a]+arr[b])==arr[c])rn System.out.print(arr[a]+"+"+arr[b]+"="+arr[c]);rn rn rn rn rn rn rn[/code]rn[color=#FF0000]输出异常[/color]123+123=246Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 504rn at ArrayTest.main(ArrayTest.java:23)rn
刚学ibatis报的错误,求大神
nested exception is java.io.IOException: Server returned HTTP response code: 403 for URL: http://ibatis.apache.org/dtd/sql-map-config-2.dtdrnrn请问这是什么错误,急死了。。。
刚做了一个记事本的java程序!!不知道哪里出错了
[code=Java]rnimport java.awt.Container;rnimport java.awt.event.ActionEvent;rnimport java.awt.event.InputEvent;rnimport java.awt.event.KeyEvent;rnimport java.awt.event.MouseAdapter;rnimport java.awt.event.MouseEvent;rnrnrnimport javax.swing.AbstractAction;rnimport javax.swing.Action;rnimport javax.swing.ButtonGroup;rnimport javax.swing.JCheckBoxMenuItem;rnimport javax.swing.JFrame;rnimport javax.swing.JMenu;rnimport javax.swing.JMenuBar;rnimport javax.swing.JMenuItem;rnimport javax.swing.JPanel;rnimport javax.swing.JPopupMenu;rnimport javax.swing.JRadioButtonMenuItem;rnimport javax.swing.JTextField;rnimport javax.swing.JToolBar;rnimport javax.swing.KeyStroke;rnrnrnpublic class MenuUseDemo extends JFramernrn public static final int WIDTH=250;rn public static final int Height=200;rn private JMenuItem newItem;rn private JMenuItem openItem;rn private JMenuItem closeItem;rn private JMenuItem saveItem;rn private JMenuItem cutItem;rn private JMenuItem copyItem;rn private JMenuItem pasteItem;rn private JMenuItem cutItemPop;rn private JMenuItem copyItemPop;rn private JMenuItem pasteItemPop;rn private JRadioButtonMenuItem forwardItem;rn private JRadioButtonMenuItem backwardItem;rn private JPopupMenu popup;rn private JTextField MyTextField;rn public MenuUseDemo()rn rn setTitle("hello");rn setSize(WIDTH,HEIGHT);rn Container contentPane=getContentPane();rn JPanel textPane1=new JPanel();rnrn myTextField=new JTextField("",20);rn textPanel.add(myTextField);rn contentPane.add(textPanel);rnrn JMenuBar menuBar=new JMenuBar();rn setJMenuBar(menuBar);rn JMenu fileMenu=new JMenu("文件");rn fileMenu.setMnemonic('F');rnrn newItem=fileMenu.add(new ShowAction("新建"));rn newItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,InputEvent.CTRL_MASK));rnrn openItem=fileMenu.add(new ShowAction("打开"));rn openItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,InputEvent.CTRL_MASK));rn fileMenu.addSeparator();rn saveItem=fileMenu.add(new ShowAction("保存"));rn saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,InputEvent.CTRL_MASK));rn saveItem.setEnabled(false);rnrn closeItem=fileMenu.add(new ShowAction("退出"));rn closeItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L,InputEvent.CTRL_MASK));rn closeItem.setEnabled(false);rn fileMenu.addSeparator();rnrn JMenuItem exitItem=new JMenuItem("退出",'T');rn exitItem.addActionListener(new AbstactAction("退出")rn rn public void actionPerformed(ActionEvent event)rn rn System.exit(0);rnrn rn );rnrn exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T,InputEvent.CTRL_MASK));rn fileMenu.add(exitItem);rnrnrn JMenu editMenu=new JMenu("编辑");rn editMenu.setMnemonic('E');rnrn cutItem=new JMenu("剪切",'C');rn editMenu.add(cutMenu);rnrn cutItem.addActionListener(new ShowAction("剪切"));rn cutItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_U,InputEvent.CTRL_MASK));rn cutItem.setEnabled(false);rnrn copyItem=new JMenu("复制",'Y');rn copyItem.addActionListener(new ShowAction("复制"));rn copyItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y,InputEvent.CTRL_MASK));rn copyItem.setEnabled(false);rnrn copyItem=new JMenu("粘贴",'P');rn copyItem.addActionListener(new ShowAction("粘贴"));rn copyItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P,InputEvent.CTRL_MASK));rn copyItem.setEnabled(false);rnrn editMenu.add(copyItem);rn eidtMenu.add(PasteItem);rnrn JMenu searchMenu= new JMenu("搜索");rn searchMenu.setMnemonic('S');rnrn ButtonGroup group=new ButtonGroup();rn forwardItem=new JRadioButtonMenuItem("Forward");rn forwardItem.addActionListener(new ShowAction("Forward"));rn forwardItem.setSelected(true);rn forwardItem.setEnabled(false);rnrn backwardItem=new JRadioButtonMenuItem("Backward");rn backwardItem.addActionListener(new ShowAction("Backward"));rn backwardItem.setEnabled(false);rnrn group.add(forwardItem);rn group.add(backwardItem);rnrn searchMenu.add(forwardItem);rn searchMenu.add(backwardItem);rnrn JMenu viewMenu=new JMenu("视图");rn viewMenu.setMnemonic('V');rnrn JMenu optionMenu=new JMenu("选项");rn optionMenu.setMnemonic('O');rnrn JCheckBoxMenuItem toolItem=new JCheckBoxMenuItem("ToolBar");rn JCheckBoxMenuItem statusItem=new JCheckBoxMenuItem("Status");rn toolItem.addActionListener(new ShowAction("ToolBar"));rn statusItem.addActionListener(new ShowAction("Status"));rnrn optionMenu.add(toolItem);rn optionMenu.add(statusItem);rnrn viewMenu.add(optionMenu);rnrn menuBar.add(fileMenu);rn menuBar.add(editMenu);rn menuBar.add(searchMenu);rn menuBar.add(viewMenu);rnrn popup=new JPopupMenu();rnrn cutItemPop=new JMenuItem("剪切",'C');rn cutItemPop.addActionListener(new ShowAction("CutPop"));rn cutItemPop.setEnabled(false);rnrnrn copyItemPop=new JMenuItem("复制",'Y');rn copyItemPop.addActionListener(new ShowAction("CopyPop"));rn copyItemPop.setEnabled(false);rnrn pasteItemPop=new JMenuItem("粘贴",'P');rn pasteItemPop.addActionListener(new ShowAction("PastePop"));rn pasteItemPop.setEnabled(false);rnrn popup.add(cutItemPop);rn popup.add(copyItemPop);rn popup.add(pasteItemPop);rnrnrn getContentPane().addMouseListener(new MouseAdapter()rn rn public void mouseReleased(MouseEvent event)rn rn if(event.isPopupTrigger())rn popup.show(event.getComPonent(),event.getX(),event.getY());rn rn );rn rnrn private class ShowAction extends AbstractActionrn rn public ShowAction(String name)rn rn super(name);rn rn rn public void actionPerformed(ActionEvent event)rn rn if(event.getSoure()==newItem||event.getSoure()==openItem)rn rn saveItem.setEnabled(true);rn closeItem.setEnabled(true);rn cutItem.setEnabled(true);rn copyItem.setEnabled(true);rn pasteItem.setEnabled(true);rn forwardItem.setEnabled(true);rn backwardItem.setEnabled(true);rn cutItemPop.setEnabled(true);rn copyItemPop.setEnabled(true);rn pasteItemPop.setEnabled(true);rn rn if(event.getSoure()==closeItem)rn rn saveItem.setEnabled(false);rn closeItem.setEnabled(false);rn cutItem.setEnabled(false);rn copyItem.setEnabled(false);rn pasteItem.setEnabled(false);rn forwardItem.setEnabled(false);rn backwardItem.setEnabled(false);rn cutItemPop.setEnabled(false);rn copyItemPop.setEnabled(false);rn pasteItemPop.setEnabled(false);rn rn myTextField.setText(getValue(Action.NAME)+"selected.");rn rnrn public static void main(String[] args)rn rn MenuUseDemo frame=new MenuUseDemo();rn frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);rn frame.setVisible(true);rn rnrnrnrnrn[/code]rnrnrn
spring整合shiro出现错误,求大神指导
有文件 链接:https://pan.baidu.com/s/1Mz6DZpA3hIXwF4uqEdHUYQ 密码:0fhfrn 异常如下rn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource [spring-shiro.xml]: Cannot resolve reference to bean 'securityManager' while setting bean property 'securityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [spring-shiro.xml]: Cannot resolve reference to bean 'myRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myRealm': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'cn.dong.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1531)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1276)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)rn at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:235)rn at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:703)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)rn at java.util.concurrent.FutureTask.run(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)rn at java.lang.Thread.run(Unknown Source)rnCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'securityManager' defined in class path resource [spring-shiro.xml]: Cannot resolve reference to bean 'myRealm' while setting bean property 'realm'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myRealm': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'cn.dong.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1531)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1276)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)rn ... 24 morernCaused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myRealm': Unsatisfied dependency expressed through field 'userService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'cn.dong.service.UserService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: @org.springframework.beans.factory.annotation.Autowired(required=true)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)rn at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)rn at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)rn ... 34 morern
打包时出现错误,求大神指导
如图,求大神指导是哪里错误了,附上app/build.gradlernrnrn图好像上传不了。二楼重新上传rnrnapply plugin: 'com.android.application'rnrnandroid rn compileSdkVersion 25rn buildToolsVersion "25.0.3"rnrn useLibrary 'org.apache.http.legacy'//Bmobrnrnrn defaultConfig rn applicationId "com.example.administrator.myone"rn minSdkVersion 24rn targetSdkVersion 25rn versionCode 1rn versionName "1.0"rn testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"rn rn buildTypes rn release rn minifyEnabled falsern proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'rn rn rnrn sourceSets rn main rn jniLibs.srcDir 'libs'rn rn rnrnrndependencies rn compile fileTree(include: ['*.jar'], dir: 'libs')rn androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', rn exclude group: 'com.android.support', module: 'support-annotations'rn )rn compile 'com.android.support:appcompat-v7:25.3.1'rn testCompile 'junit:junit:4.12'rn compile 'com.android.support:design:25.3.1'rn compile 'de.hdodenhof:circleimageview:2.1.0'rn compile 'com.android.support:recyclerview-v7:25.3.1'rn compile 'com.android.support:cardview-v7:25.3.1'rn compile 'com.android.support:percent:25.3.1'rn //compile 'com.android.support:recyclerview-v7:25.3.1'rn compile 'com.github.bumptech.glide:glide:3.7.0'rn compile files('libs/alipaySdk-20170623-proguard.jar')rn compile 'cn.bmob.android:bmob-sdk:3.5.6'rn //Bmobrn compile 'cn.bmob.android:http-legacy:1.0'rn //Bmobrn compile files('libs/BmobSDK_3.5.6_20170705.jar')rn compile 'cn.bmob.android:bmob-push:1.0.0'rn compile 'cn.bmob.android:bmob-sms:1.0.1'rnrn
openCV2.4.2+VS2010出现的错误,求大神指导。
c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2628: “_Ty”后面接“float”是非法的(是否忘记了“;”?)rn1> c:\program files\microsoft visual studio 10.0\vc\include\complex(533): 参见对正在编译的类 模板 实例化“std::_Complex_base<_Ty,_Valbase>”的引用rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2059: 语法错误:“”rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2334: “”的前面有意外标记;跳过明显的函数体rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2628: “_Ty”后面接“float”是非法的(是否忘记了“;”?)rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2059: 语法错误:“”rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2334: “”的前面有意外标记;跳过明显的函数体rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2628: “_Ty”后面接“float”是非法的(是否忘记了“;”?)rn1> c:\program files\microsoft visual studio 10.0\vc\include\complex(538): 参见对正在编译的类 模板 实例化“std::_Complex_base<_Ty,_Valbase>”的引用rn1> withrn1> [rn1> _Ty=float,rn1> _Valbase=std::_Fcomplex_valuern1> ]rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2059: 语法错误:“”rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2334: “”的前面有意外标记;跳过明显的函数体rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2628: “_Ty”后面接“float”是非法的(是否忘记了“;”?)rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2059: 语法错误:“”rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2334: “”的前面有意外标记;跳过明显的函数体rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2628: “_Ty”后面接“float”是非法的(是否忘记了“;”?)rn1> c:\program files\microsoft visual studio 10.0\vc\include\complex(669): 参见对正在编译的类 模板 实例化“std::_Complex_base<_Ty,_Valbase>”的引用rn1> withrn1> [rn1> _Ty=double,rn1> _Valbase=std::_Dcomplex_valuern1> ]rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2059: 语法错误:“”rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2334: “”的前面有意外标记;跳过明显的函数体rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2628: “_Ty”后面接“float”是非法的(是否忘记了“;”?)rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2059: 语法错误:“”rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2334: “”的前面有意外标记;跳过明显的函数体rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2628: “_Ty”后面接“float”是非法的(是否忘记了“;”?)rn1> c:\program files\microsoft visual studio 10.0\vc\include\complex(794): 参见对正在编译的类 模板 实例化“std::_Complex_base<_Ty,_Valbase>”的引用rn1> withrn1> [rn1> _Ty=long double,rn1> _Valbase=std::_Lcomplex_valuern1> ]rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2059: 语法错误:“”rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(429): error C2334: “”的前面有意外标记;跳过明显的函数体rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2628: “_Ty”后面接“float”是非法的(是否忘记了“;”?)rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2059: 语法错误:“”rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(439): error C2334: “”的前面有意外标记;跳过明显的函数体rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(914): error C2274: “函数样式转换”: 位于“.”运算符右边时非法rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(921): error C2274: “函数样式转换”: 位于“.”运算符右边时非法rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(928): error C2274: “函数样式转换”: 位于“.”运算符右边时非法rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(935): error C2274: “函数样式转换”: 位于“.”运算符右边时非法rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(942): error C2274: “函数样式转换”: 位于“.”运算符右边时非法rn1>c:\program files\microsoft visual studio 10.0\vc\include\complex(949): error C2274: “函数样式转换”: 位于“.”运算符右边时非法rn1>c:\program files\microsoft visual studio 10.0\vc\include\xcomplex(183): error C2628: “_Ty”后面接“float”是非法的(是否忘记了“;”?)rn1>c:\program files\microsoft visual studio 10.0\vc\include\xcomplex(183): error C2027: 使用了未定义类型“_Ty”rn1>c:\program files\microsoft visual studio 10.0\vc\include\xcomplex(183): error C2226: 语法错误 : 意外的“std::complex<_Other>”类型rn1>c:\program files\microsoft visual studio 10.0\vc\include\xcomplex(190): error C2065: “_Ty”: 未声明的标识符rn1>c:\program files\microsoft visual studio 10.0\vc\include\xcomplex(191): error C2143: 语法错误 : 缺少“;”(在“”的前面)
求指导,刚学java
[img=http://img.my.csdn.net/uploads/201211/06/1352208999_3101.jpg][/img]
刚学注解,出现错误,求解释
strut2的action里面:rn[code="java"]rn@Namespace("/acctuser")rn@Results( @Result(name = CrudActionSupport.OK, location = "acctuser",type="chain") )rn@Component("acctuser")rn@Scope("prototype")rn@SuppressWarnings("serial")rnpublic class AcctuserAction extends CrudActionSupport rnrn @Autowiredrn private IAcctUserService iAcctUserService;rn[/code]rnservice里面:rn[code="java"]rn@Service("iAcctUserService")rn@Transactionalrnpublic class AcctUserService implements IAcctUserServicern rn @Autowiredrn private IAcctUserDao iAcctUserDao;rn[/code]rndao里面:rn[code="java"]rn@Repository("iAcctUserDao")rnpublic class AcctUserDao extends BaseDao implements IAcctUserDaornrn public boolean login(String uname, String upass) rn String sql = "select count(*) from acct_user where login_name='"rn + uname + "' and password='" + upass + "'";rn int count=jdbcTemplate.queryForInt(sql);rn if(count>0)rn return true;rn rn return false;rn rn[/code]rnbasedao:rn[code="java"]rnpublic class BaseDao rn @Autowiredrn public JdbcTemplate jdbcTemplate;rn[/code]rnapplication.xml里面rn[code="java"]rnrn rn rn rn rn classpath*:/util.propertiesrn rn rn rnrn rn rnrn rn rn rn rn rn rn rn rn rnrn rn rn rnrn[/code]
刚学Ajax怎么也不知道哪里出错了
[code=Java]rnrnrnrn rn 动态获取列表rn rnrn rn rn rn rn 请选择:rn 1列表rn 2列表rn rn rn rn 请选择:rn rnrn rn rnrn[/code]rnrn[code=XML]rnrnrnrn 1列表rn 2列表rnrnrnrn 3列表rn 3列表rnrnrnrn[/code]rnrn就是想实现一个 列表的动态改变 不知道哪里出错了
合并排序哪里错了求指导
[code=c]#include "stdio.h"rnrn#define N 8rn#define MAX 65535rnrnrnvoid merge(int test[],int start,int middle,int end);rnvoid merge_sort(int test[],int start,int end);rnrnint main(void)rnrn int i,test[N]=12,14,52,3,1,63,25,8;rnrn for(i=0;i> 1;rn merge_sort( test, start, t );rn merge_sort( test, t+1, end);rn merge(test, start, t, end);rn rn rnrnrnrn/*rn*****************************************************************rn******:函数功能:实现2个有序数组的合并rn******:函数名 :merge(int test[],int p,int t,int r)rn******:入口参数:test[]待排序数组,p数组开始位置,t数组中间分隔位置,r数组末尾位置rn******:返回值 :无rn*/rnrnvoid merge(int test[],int start,int middle,int end)rnrnrn int temp1[N]=0,temp2[N]=0;//定义并初始化辅助数组rn int i,j,k;rn int n1; //设置辅助数组1大小rn int n2; //设置辅助数组2大小rnrn n1=middle-start+1; //设置辅助数组1大小rn n2=end-middle; //设置辅助数组2大小rnrn for(i=0; i
刚学java,这段代码不知道哪里错了
[img=https://img-bbs.csdn.net/upload/201510/18/1445136954_865331.png][/img]rn还没有学习java的数组,但老师让写这么一个代码,在网上搜了错误应该是数组越界,我还是没发现越界。rn还有我在网上看斯坦福的公开课,都叫实例变量,课本里叫成员变量,网上又说实例变量就是成员变量的,也有说不是的,是一样的么?
刚学jdbc,不知道哪里错了,希望指点一下
package jDBC;rnrnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnrn/**rn * 2015年12月31日15:36:51rn * @author Administratorrn * 演示使用jdbc-odbc方式访问emp数据表rn * 1配置数据源rn * 2在程序中连接数据源rn * rn */rnpublic class JdbcTest rn public static void main(String[] args)rn Connection ct = null;rn Statement sm = null;rn rn try rn //1加载驱动rn Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");rn //2得到连接rn //如果配置数据源的时候选择windows验证,则不需要用户名和密码rn ct = DriverManager.getConnection("jdbc:odbc:mytest", "sa", "954799698");rn //3创建Statemet或者PerpaerdStatement区别rn //Statement主要用于发送sql语句rn sm = ct.createStatement();rn rn //4执行crud创建数据库,备份数据库,删除数据rn //1、添加一条数据到dept表rn //executeUpdate可以执行cud操作(添加,删除,修改rn System.out.println("Hello Word!");rn int i = sm.executeUpdate("insert into dept('50', 'NAME', 'NO')");rn if(i == 1)rn System.out.println("添加OK!");rn rn elsern System.out.println("操作失败!");rn System.out.println("Hello Word!");rn rn rn catch (Exception e) rn // TODO: handle exceptionrn finallyrn System.out.println("Hello Word!");rn //关闭资源rn try rn rn //为了程序健壮rn if(sm != null)rn sm.close();rn rn if(ct != null)rn ct.close();rn rn rn rn catch (SQLException e) rn // TODO 自动生成的 catch 块rn e.printStackTrace();rn rn rn rnrn
一段ajax的简单代码。刚学不知道哪里出错了
运行后网页下角出现网页错误。麻烦懂的看下是打错了还是语句出错。。本人的初学者rn这段还没连接数据库。正常运行会弹出个窗口里面提示。rn
求大神指点 哪里错了?
private void lblMode_MouseClick(object sender, MouseEventArgs e)rn rn if (e.Button != MouseButtons.Left)rn return;rn int xPos, yPos;rn xPos = e.X / 31;rn yPos = e.Y / 31;rn struArr[xPos, yPos] = !struArr[xPos, yPos];rn bool b = struArr[xPos, yPos];rn Graphics gp = lblMode.CreateGraphics();rn SolidBrush s = new SolidBrush(b ? blockColor : Color.Black);rn gp.FillRectangle(s, 31 * xPos + 1, 31 * yPos + 1, 30, 30);rn gp.Dispose;rn
求大神看看哪里错了
12-16 18:08:09.120 6564-6564/? E/AndroidRuntime: FATAL EXCEPTION: mainrn java.lang.IllegalStateException: ArrayAdapter requires the resource ID to be a TextViewrn at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:386)rn at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)rn at android.widget.AbsListView.obtainView(AbsListView.java:2424)rn at android.widget.ListView.makeAndAddView(ListView.java:1781)rn at android.widget.ListView.fillDown(ListView.java:679)rn at android.widget.ListView.fillFromTop(ListView.java:739)rn at android.widget.ListView.layoutChildren(ListView.java:1632)rn at android.widget.AbsListView.onLayout(AbsListView.java:2254)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644)rn at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502)rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1415)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644)rn at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1633)rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1417)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.FrameLayout.onLayout(FrameLayout.java:431)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644)rn at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502)rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1415)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.widget.FrameLayout.onLayout(FrameLayout.java:431)rn at android.view.View.layout(View.java:11467)rn at android.view.ViewGroup.layout(ViewGroup.java:4238)rn at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1721)rn at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2678)rn at android.os.Handler.dispatchMessage(Handler.java:99)rn at android.os.Looper.loop(Looper.java:137)rn at android.app.ActivityThread.main(ActivityThread.java:4514)rn at java.lang.reflect.Method.invokeNative(Native Method)rn at java.lang.reflect.Method.invoke(Method.java:511)rn at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)rn at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)rn at dalvik.system.NativeStart.main(Native Method)rn Caused by: java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.widget.TextViewrn at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:379)rn at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362) rn at android.widget.AbsListView.obtainView(AbsListView.java:2424) rn at android.widget.ListView.makeAndAddView(ListView.java:1781) rn at android.widget.ListView.fillDown(ListView.java:679) rn at android.widget.ListView.fillFromTop(ListView.java:739) rn at android.widget.ListView.layoutChildren(ListView.java:1632) rn at android.widget.AbsListView.onLayout(AbsListView.java:2254) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644) rn at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502) rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1415) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644) rn at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1633) rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1417) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.FrameLayout.onLayout(FrameLayout.java:431) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644) rn at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502) rn at android.widget.LinearLayout.onLayout(LinearLayout.java:1415) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.widget.FrameLayout.onLayout(FrameLayout.java:431) rn at android.view.View.layout(View.java:11467) rn at android.view.ViewGroup.layout(ViewGroup.java:4238) rn at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1721) rn at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2678) rn at android.os.Handler.dispatchMessage(Handler.java:99) rn at android.os.Looper.loop(Looper.java:137) rn at android.app.ActivityThread.main(ActivityThread.java:4514) rn at java.lang.reflect.Method.invokeNative(Native Method) rn at java.lang.reflect.Method.invoke(Method.java:511) rn at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993) rn at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760) rn at dalvik.system.NativeStart.main(Native Method) 
求大神帮忙!!哪里错了???
#include rnusing namespace std;rnrnclass xunhuanchain;rnrnclass nodernrnpublic:rn friend xunhuanchain;rnprivate:rn int data;rn node *link;rnrn;rnrnclass xunhuanchainrnrnpublic:rn xunhuanchain()head=new node;head=head->link;rn ~xunhuanchain();rnrn int nodesearch(int k); //查找krn bool insertnode(int k,int x); //在k后插入xrn bool deletenode(int k); //删除k节点前面的节点rnrnprivate:rn node *head; //头结点rn node *current; //指针rn;rnrnrnint xunhuanchain::nodesearch(int k) rnrn int index=1;rn node *temp=head->link;rn temp->data=k;rn while (temp->data!=k)rn temp=temp->link;rn index++;rn rn current=temp; //另current指针指向指向k所在节点rn return (temp==head) ?0:index;rnrnrnbool xunhuanchain::insertnode(int k,int x)rnrn nodesearch(k);rn [color=#FF0000]node *t=new node;[/color] //编译时这里会报错rn rnrn if (head==0)rn rn system("pause");rn rn head->link=t;rn t->link=head;rn t->data=x;rn return true;rn rn t->data=x;rn t->link=current->link;rn current->link=t;rnrn return true;rnrnrnbool xunhuanchain::deletenode(int k)rnrnrn if (nodesearch(k)==0) cout<<"无k节点"<link;rn node *temp3=temp2->link;rn rn while(temp3->data!=k)rn temp3=temp3->link;rn temp2=temp2->link;rn temp1=temp1->link;rn rn temp1->link=temp3;rn return true;rnrnrnint main()rnrn int a;rn system("pause");rn xunhuanchain ch1;rn system("pause");rn cout<<"输入节点"<>a;rn ch1.deletenode(a);rn system("pause");rn return 0;rn
刚学 现在是找不到哪里出错了、、、、
[img=https://img-bbs.csdn.net/upload/201804/12/1523517892_402076.png][/img][img=https://img-bbs.csdn.net/upload/201804/12/1523517909_531739.png][/img]rnrn大神 抬抬手指 指点下小白
刚学,请问这就SQL哪里错了
SELECT * FROM coc_ecms_blog where 1 AND userid='9' AND truetime>=1235213750 AND checked=1 ORDER BY DESC LIMIT 0,5
求大神指导求大神指导求大神指导
1>main.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall CSpeechRecognition1::CSpeechRecognition1(void)" (??0CSpeechRecognition1@@QAE@XZ),该符号在函数 "public: __thiscall main::main(class CWnd *)" (??0main@@QAE@PAVCWnd@@@Z) 中被引用rn1>main.obj : error LNK2001: 无法解析的外部符号 "public: virtual int __thiscall main::OnInitDiaLog(void)" (?OnInitDiaLog@main@@UAEHXZ)rn1>main.obj : error LNK2019: 无法解析的外部符号 "public: virtual __thiscall CSpeechRecognition1::~CSpeechRecognition1(void)" (??1CSpeechRecognition1@@UAE@XZ),该符号在函数 "public: virtual __thiscall main::~main(void)" (??1main@@UAE@XZ) 中被引用rn1>D:\tttttt\RecordSpeech\Debug\RecordSpeech.exe : fatal error LNK1120: 3 个无法解析的外部命令
求大神指导,找不到错误
#includernint main()rnrnint a[3][3];rnint i,j,c,b,m=0;rnscanf("%d",&a[3][3]);rnfor(i=0;i<3;i++)rn for(j=0;j<3;j++)rnc=i+1;rnb=j+1;rnif(a[i][j]==a[c][b])rnm=1;rnelsernm=0;rnrnif(m=1)rnprintf("yes\n");rnelsernprintf("no\n");rnreturn 0;rnn题目是:输入一组3*3的二维数组,若有数字重复则输出yes,否则输出no
杭电acm2031。。求高手指导。。不知道哪里错了。
题目如下:rnProblem Descriptionrn输入一个十进制数N,将它转换成R进制数输出。rn rnrnInputrn输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(2<=R<=16, R<>10)。rnrn rnrnOutputrn为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的数字规则参考16进制(比如,10用A表示,等等)。rn rnrnSample Inputrn7 2rn23 12rn-4 3rn rnrnSample Outputrn111rn1Brn-11rnrnrnrnrn我的代码:rn#include rnrnusing namespace std;rnvoid sw(int, int);rnint main()rnrn int n, r;rn while(cin>>n>>r)rn rn if(n<0)rn rn cout<<'-';rn n=-n;rn rn sw(n, r);rn cout<10)rn printf("%c",'A'+a%b-10);rn elsern cout<rnint main()rnrn int n, r, i, k;rn char b[40];rn while (scanf("%d %d", &n, &r) == 2)rn if (n == 0)rn printf("0\n");rn continue;rn rn if (n < 0)rn printf("-");rn n = -n;rn rn k = 0;rn while (n)rn b[k++] = n%r;rn n /= r;rn rn for (i=k-1; i>=0; i--)rn printf("%c", b[i]<10 ? b[i]+'0' : b[i]-10+'A');rn printf("\n");rn rn return 0;rn*/
刚学 求大佬指点一下哪里错了
public class MainActivity extends AppCompatActivity rnrn @Overridern protected void onCreate(Bundle savedInstanceState) [img=https://img-bbs.csdn.net/upload/201703/16/1489625784_43960.png][/img]rn super.onCreate(savedInstanceState);rn setContentView(R.layout.activity_main);rn //找到我们关心的控件rn EditText p1= (EditText) findViewById(R.id.editText);rn Button p2 = (Button) findViewById(R.id.button);rn p2.setOnClickListener(new Myclicklistener() );rn rn //定义一个类去实现按钮需要的接口类型rn private class Myclicklistener implements OnClickListenerrn public void onClick(View v)rnrn System.out.println("按钮被点击了");rn rn rn
lcd程序问题,我不知道哪里错了,求大神指点一下
void main() lcd_init(); write_data(0,1,"A"); while(1);void lcd_init(void) write_command(0x38); write_command(0x0c); write_command(0x06); write_command(0x01);void write_command(uchar command) RS=0; RW=0; E=1; E=0; Data=command; delay(1);void write_data(uint x,uint y,uchar da) uchar ad; if(y==1) ad=0x80+x; else ad=0xc0+x; write_command(ad); LCDdate(ad);void LCDdate(uchar da) Data=da; RS=1; RW=0; E=1; E=0; delay(1);void delay(uint n) uint i; uchar j; for(i=n;i>0;i--) for(j=2;j>0;j--);
新人刚学.net不久找个大神当师傅啊!
以后想主要在软件方面发展,想找为大神当引路人,指点迷津。[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/onion/3.gif][/img]rn
各位 不知道哪里错了 求大神看一下好吗
先贴一下报错:HTTP Status 404 - There is no Action mapped for namespace [/] and action name [userAction_login] associated with context path [/video].rn我是真的不知道哪里错 求各位大神帮帮忙。好吗rn另外 我Struts、hibernate、spring都是最新版本的 。而且我actionrn这是结构:struts.xml在src路径下rn[img=https://img-bbs.csdn.net/upload/201803/06/1520347303_648539.png][/img]rn这是struts.xmlrn[code=text]rnrnrn rn rn /success.jsprn /success.jsprn rn rn[/code]rn这是action类的:我save方法可以实现,login方法不行rn[code=java]package action;rnrnimport com.opensymphony.xwork2.ActionSupport;rnimport com.opensymphony.xwork2.ModelDriven;rnrnimport bean.User;rnimport service.UserService;rnrnpublic class UserAction extends ActionSupport implements ModelDrivenrn /**rn * rn */rn private static final long serialVersionUID = 1L;rn private User user = new User();rnrn @Overridern public User getModel() rn return user;rn rn rn private UserService userService;rn rnrn public void setUserService(UserService userService) rn this.userService = userService;rn rn rn public String save()rn this.userService.saveUser(user);rn System.out.println("action:save");rn return "userSave";rn rn rn rn //用户登入rn public String login()rn this.userService.findUser(user);rn System.out.println("action:login");rn return "login";rn rn rn[/code]rn这是index.jsp的rn[code=text]<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>rn<%rnString path = request.getContextPath();rnString basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";rn%>rnrnrnrn rn rn rn My JSP 'index.jsp' starting pagern rn rn rn rn rn rn rn rn rn rn 登入名: rn 密码: rn rn rn rnrn[/code]rn这是applicationContext.xml:rn[code=java]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 rn rn rn rn rn rn rn rn rn rn rn rn rn[/code]rn
求c语言这题哪里错了 小弟刚学数构 求大神
采用先序输入二叉树各元素值建立二叉树(二叉链表存储结构),采用中序遍历非递归的算法输出各个元素rnrnTime Limit:1000MS Memory Limit:65536KrnTotal Submit:17 Accepted:12rnrnDescriptionrnrn采用先序输入二叉树各元素值建立二叉树(二叉链表存储结构),(空二叉树用'#'表示),采用中序遍历非递归的算法输出各个元素。注意本题要求,若是空二叉树,需输出一个"#",如测试数据5,课利用之前写过的栈。rnrnInputrnrn第1组输入 rnABDH#K###E##CFI###G#J## rn第1组输出 rnHKDBEAIFCGJ rnrn第2组输入 rnAB#D##C## rn第2组输出 rnBDAC rnrn第3组输入 rnABDHP##Q##IR##S##EJT##U##KV##W##CFLS##Y##MZ###GN##O## rn第3组输出 rnPHQDRISBTJUEVKWASLYFZMCNGO rnrn第4组输入 rnABD#IR##S##EJT##U##KV##W##CFLS##Y##MZ###GN##O## rn第4组输出 rnDRISBTJUEVKWASLYFZMCNGO rnrn第5组输入 rn# rn第5组输出 //特别注意此组输出,之前写的空二叉树不要求输出,本题要求有输出 rn# rnrnrn第6组输入 rnABDHP##Q##IR##S###CFLS##Y##MZ#### rn第6组输出 rnPHQDRISBASLYFZMC rnrnOutputrnrnrnSample InputrnrnrnSample OutputrnrnrnSourcern以下是我的编码rn#include rn#include rn#includern#define OK 1rn#define ERROR 0rn#define TRUE 1rn#define FALSE 0rntypedef int Status; rntypedef char TElemType;rntypedef char SElemType;rntypedef struct BiTNodernrn TElemType data;rn struct BiTNode *lchild,*rchild;rnBiTNode,*BiTree;rntypedef struct SNodernrn SElemType data;rn struct SNode *next;rnStackNode,*LinkStack;rnrnStatus InitBiTree(BiTree &T)rn rn T=NULL;rn return OK;rnrnStatus CreateBiTree(BiTree & T)rn//按先序次序输入二叉树中结点的值(一个字符),#号表示空树rnrnrn TElemType ch;rn scanf("%c",&ch);rn if(ch=='#')rn T=NULL;rn elsern rn T=(BiTNode*)malloc(sizeof(BiTNode));rn if(!T)rn return ERROR;rn T->data=ch;rn CreateBiTree(T->lchild);rn CreateBiTree(T->rchild);rn rn return OK;rnrn rnrnStatus Visit(TElemType e)rnrn printf("e");rn return OK;rnrnrnStatus InitStack(LinkStack &S) rnrnrn S=NULL;rn return OK;rnrnrnStatus Push(LinkStack &S,SElemType e)rnrnLinkStack p;rn p=(LinkStack)malloc (sizeof(StackNode));rn if (!p) return ERROR;rn p->data=e;rn p->next=S;rn S=p;rn return OK;rnrnrnrnStatus Pop(LinkStack &S,SElemType &e)rnrn LinkStack p;rnif(S=NULL)rnreturn ERROR;rne=S->data;rnp=S;rnS=S->next;rnfree(p);rnreturn OK;rnrnrnStatus InOrderTraverse(BiTree T,Status(*Visit)(TElemType e))rnrnLinkStack S;rnInitStack(S);rnBiTree p;rnp=T;rnwhile(p || InitStack(S))rnrn if(p)rn rn Push(S,p);rn p=p->lchild;rn rnelsernrn Pop(S,p);rn if(!Visit(p->data))rn return ERROR;rn p=p->rchild;rnrnreturn OK;rnrnrnvoid main()rn TElemType ern BiTree T;rn CreateBiTree(T);rn InOrderTraverse(T,e);rn rnrn错误详情如下rn--------------------Configuration: 新建文本文档 - Win32 Debug--------------------rnCompiling...rn新建文本文档.cpprnC:\Users\Administrator\Desktop\新建文本文档.cpp(95) : error C2664: 'Push' : cannot convert parameter 2 from 'struct BiTNode *' to 'char'rn This conversion requires a reinterpret_cast, a C-style cast or function-style castrnC:\Users\Administrator\Desktop\新建文本文档.cpp(100) : error C2664: 'Pop' : cannot convert parameter 2 from 'struct BiTNode *' to 'char &'rn A reference that is not to 'const' cannot be bound to a non-lvaluernC:\Users\Administrator\Desktop\新建文本文档.cpp(109) : error C2601: 'main' : local function definitions are illegalrnC:\Users\Administrator\Desktop\新建文本文档.cpp(115) : fatal error C1004: unexpected end of file foundrn执行 cl.exe 时出错.rnrn新建文本文档.obj - 1 error(s), 0 warning(s)rn
求大神指导,我真的不知道错在了哪里?
[img=https://img-bbs.csdn.net/upload/201512/05/1449327036_512773.png][/img]rnrnrn求大神指导小白,第二个显示为什么没有按照格式输出,搞了好久没有搞出来,唉,,
hdu2005 实在不知道怎么错了 求指导
Problem Descriptionrn给定一个日期,输出这个日期是该年的第几天。rn rnrnInputrn输入数据有多组,每组占一行,数据格式为YYYY/MM/DD组成,具体参见sample input ,另外,可以向你确保所有的输入数据是合法的。rn rnrnOutputrn对于每组输入数据,输出一行,表示该日期是该年的第几天。rn rnrnSample Inputrn1985/1/20rn2006/3/12rn rnrnSample Outputrn20rn71rnrn#includernint main()rnrn int y, m, d;rn int a[] = 31,28,31,30,31,30,31,31,30,31,30 ;rn while (scanf(" %d/%d/%d", &y, &m, &d) != EOF)rn rn int x = 0, i;rn if ((y % 100 != 0 && y % 4 == 0) || (y % 400 == 0))rn rn a[1] = a[1] + 1;rn rn for (i = 0; i < m - 1; i++)rn rn x = x + a[i];rn rn x = x + d;rn printf("%d\n", x);rn rn return 0;rnrn实在不知道怎么错了orz
出现错误!!高手 求救 不知道 哪里设置错了
[color=#FF0000]回发或回调参数无效。在配置中使用 或在页面中使用 <%@ Page EnableEventValidation="true" %> 启用了事件验证。出于安全目的,此功能验证回发或回调事件的参数是否来源于最初呈现这些事件的服务器控件。如果数据有效并且是预期的,则使用 ClientScriptManager.RegisterForEventValidation 方法来注册回发或回调数据以进行验证。[/color]rn我做了一个界面,在这个界面中有一个datagird来显示数据,我要对这个数据进行修改,所以我在dataGird中添加了一个选择的按键,可是运行的时候不会出错可是我点 选择 按键 就出现上面的错误,选择的代码 没写错,我是在 dataGird里面的 selectcommand事件里面写的, 根本就没有触发这个事件 就出现了上面的错误
运行程序出现“段错误”,不知道哪里错了...
[code=C/C++]rn/*1. 自行定义并实现一个类,其中可以包含一个数值型成员,如long id的数据成员(类似学号、身份证号、车牌号等)和至少一个静态数据成员(如总人数,总载客数,总面积等)。rnrn2 .成员函数:相关的构造函数,拷贝构造函数,析构函数,显示数字成员的函数(注意构造函数和析构函数中,对静态数据成员的操作)。rnrn3.一定要有一个能够用类名来调用获取静态数据成员值的静态成员函数,例如getTotal()之类。rnrn4.为该类的对象进行关系判断(>,<,==,!=中至少一种),如根据id值判断是否相等,定义相等判断运算符(‘==’)重载函数。rnrnrn5.在上述类的基础上派生新的类,增加相应的数据成员,其中至少包含一个字符指针。写出派生类的完整定义(包括构造、拷贝构造、赋值运算符(‘=’)重载、析构成员函数的实现)。rnrn6.写一个主函数来测试基类和派生类,使每一个成员函数得到应用。*/rnrn#includern#includernusing namespace std;rnrnclass CStudentrnrnprotected:rn long id;rn char *s_name;rn static int total;rnpublic:rn CStudent(const long i, const char *s_n)rn rn id = i;rn s_name = new char [strlen(s_n) + 1];rn strcpy(s_name, s_n);rn total++;rn rn CStudent(const CStudent &c)rn rn id = c.id;rn delete [] s_name;rn s_name = new char [strlen(c.s_name) + 1];rn strcpy(s_name, c.s_name);rn total++;rn rn static int getTotal()rn rn return total;rn rn friend bool operator == (const CStudent &c, const CStudent &d);rn friend bool operator != (const CStudent &c, const CStudent &d);rn void print()constrn rn cout << "_____NO." << total << " STUDENT_____" << endl;rn cout << "Student's ID: " << id << endl;rn cout << "Student's name: " << s_name << endl;rn rn virtual ~CStudent()rn rn delete [] s_name;rn total--;rn rn virtual void ptalent() ;rn;rnrnint CStudent::total = 0;rnbool operator == (const CStudent &c, const CStudent &d)rnrn if (c.id == d.id)rn return false;rn elsern return true;rnrnbool operator != (const CStudent &c, const CStudent &d)rnrn return !(c == d);rnrnrnclass CTalent:public CStudentrnrnprotected:rn char *t_talent;rnpublic:rn CTalent(const long i, const char *s_n, const char *t_tal):CStudent(i, s_n)rn rn t_talent = new char [strlen(t_tal) + 1];rn strcpy(t_talent, t_tal);rn rn CTalent(const CTalent &e):CStudent(e)rn rn delete [] t_talent;rn t_talent = new char [strlen(e.t_talent) + 1];rn strcpy(t_talent, e.t_talent);rn rn CTalent& operator = (const CTalent &e)rn rn if(this == &e);rn return *this;rnrn delete [] s_name;rn s_name = new char [strlen(e.s_name) + 1];rn strcpy(s_name, e.s_name);rn id = e.id;rn return *this;rn rn void ptalent ()rn rn cout << "Student's talent" << t_talent << endl;rn rn ~CTalent()rn rn delete [] t_talent;rn rn;rnrnint main()rnrn int i;rn CStudent *student[i];rn int ans;rn long id;rn char name[20], talent[20];rnrn for(i = 1; i <= 100; i++)rn rn cout << "Enter choice(1 for general students, 2 for talented students, 3 for exit): " ;rn cin >> ans;rn if (ans == 3)rn break;rn cout << "Enter student's ID and name" << endl;rn cin >> id >> name;rn switch (ans)rn rn case 1:rn student[i] = new CStudent(id , name);rn student[i]->print();rn break;rnrn case 2:rn cout << "Enter talent" << endl;rn cin >> talent;rn student[i] = new CTalent(id , name, talent);rn student[i]->print();rn student[i]->ptalent();rn break;rnrn case 3:rn break;rnrn default:rn cout << "Worng chioce!" << endl;rn return 0;rn rn cout << "______________________" << endl;rn cout << endl;rn rn if(student[i] == student[i-1])rn cout << "Error!" <
Java 出现死循环,不知道哪里错了?
[code=java] public static void main(String [] args)rn rn String i = "Hello world Hello";rn String test = "Hello";rn rn int count = 0;rn int index = 0;rn dorn rn count ++;rn index = i.indexOf(test); //在i中搜索Hello字符rn index += test.length(); // 获得下一个开始索引rn index = i.indexOf(test, index); //在指定索引处继续往后搜索rn rn while(index!=-1); //index不等于-1时继续执行上述代码查找字符。rn System.out.println(count);rn [/code]rnrn我的原意是编写一个程序,这个程序计算字符串中Hello字符出现的次数,可是陷入了死循环,怎么都看不出到底是哪里导致的,而且我点击编译运行,机器变得异常的卡,机器配置本来就不高,请看出哪里错误的朋友指出,谢谢~。
相关热词 c# stream 复制 android c# c#监测窗口句柄 c# md5 引用 c# 判断tabtip 自己写个浏览器程序c# c# 字符串变成整数数组 c#语言编程写出一个方法 c# 转盘抽奖 c#选中treeview