小编UnP*_*uac的帖子

我在SQL命令中收到错误未正确结束

当我进入这个

INSERT INTO works_on
(essn, pno, hours)
values
('123456789', 1, 32.5),
('123456789', 2, 7.5),
('666884444', 3, 40.0),
('453453453', 1, 20.0),
('453453453', 2, 20.0),
('333445555', 2, 10.0),
('333445555', 3, 10.0),
('333445555', 10, 10.0),
('333445555', 20, 10.0),
('999887777', 30, 30.0),
('999887777', 10, 10.0),
('987987987', 10, 35.0),
('987987987', 30, 5.0),
('987654321', 30, 20.0),
('987654321', 20, 15.0),
('888665555', 20, 0);
Run Code Online (Sandbox Code Playgroud)

我得到了跟随错误

ORA-00933:SQL命令未正确结束

sql sqlcommand oracle11g

7
推荐指数
1
解决办法
2万
查看次数

如何在java中创建直方图

可能重复:
如何在java中将数字转换为符号?例如,而不是2到**,或3到***等.

如何将数字转换为直方图?直方图应根据该值的滚动次数显示2-12的条形图.目前我的输出就像第二张图片,但假设看起来像第一张图片.谢谢. 像这样: 在此输入图像描述

    public static void main(String[] args) {
    // TODO code application logic here
    System.out.print("Please enter how many times you want to roll two dice?");
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int [] rolls = new int[n];

    Random r1 = new Random();
    Random r2 = new Random();

    int dice1;
    int dice2;

    int two = 0;
    int three = 0;
    int four = 0;
    int five = 0;
     int six = 0;
    int seven = 0;
    int …
Run Code Online (Sandbox Code Playgroud)

java arrays histogram

3
推荐指数
1
解决办法
6万
查看次数

求和二维数组

我想添加每个州的投票总数和这个二维数组的每个候选人的总和.

这些是要求:

  • 修改程序,以便显示每个州投票的总票数
    (即,每行添加一列,汇总每个州所有候选人的总投票数)
  • 修改程序,以便显示每个候选人的总投票数(即,添加最后一行,显示所有三列投票的总投票数)

    public static void main(String[] args) throws IOException
    {
    // TODO code application logic here
    File election = new File("voting_2008.txt");
    Scanner sc = new Scanner(election);
    
    String[] states = new String[51];
    int[][]votes = new int[51][4];
    int[] Totalbystate = new int[votes.length];
    
    for (int s=0; s < 51; s++)
    {
        states[s] = sc.nextLine();
    }
    
    for(int c=0; c < 3; c++)
    {
        for(int s=0; s < 51; s++)
        {
            votes[s][c] = sc.nextInt(); 
        }
    
    }
    Formatter fmt = new Formatter();
    fmt.format("%20s%12s%12s%12s%21s", …
    Run Code Online (Sandbox Code Playgroud)

java arrays multidimensional-array

0
推荐指数
1
解决办法
1115
查看次数

如何打印循环发生的次数?

我正在尝试确定对线性和二进制搜索技术进行了多少次比较.谁能告诉我如何打印出每个案例发生循环的次数?例如,要在第一个数组中找到5,循环只发生一次.

       public static void main(String[] args) {
    // TODO code application logic here
    int[] values  = {5, 8, 6, 2, 1, 7, 9, 3, 0, 4, 20, 50, 11, 22, 32, 120};
    int[] valuesSorted  = {1, 2, 3, 4, 5, 8, 16, 32, 51, 57, 59, 83, 90, 104};
    DisplayArray(values);
    DisplayArray(valuesSorted);

    int index;
    index = IndexOf(1, values);
    System.out.println("1 is at values location " + index);
    index = IndexOf(120, values);

    System.out.println("120 is at values location " + index);

    index = BinaryIndexOf(104, …
Run Code Online (Sandbox Code Playgroud)

java loops

0
推荐指数
1
解决办法
1047
查看次数

如何在java中将数字转换为符号?例如,而不是2到**,或3到***等.

可能重复:
在java中重复String的简单方法

如何将数字转换为符号?我的任务的最后一部分是这样的:直方图应根据该值的滚动次数显示2-12的条形图.如下所示: 像这样: 目前我的输出是这样的:在此输入图像描述

    public static void main(String[] args) {
    // TODO code application logic here
    System.out.print("Please enter how many times you want to roll two dice?");
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int [] rolls = new int[n];

    Random r1 = new Random();
    Random r2 = new Random();

    int dice1;
    int dice2;

    int two = 0;
    int three = 0;
    int four = 0;
    int five = 0;
     int six = 0;
    int seven = 0; …
Run Code Online (Sandbox Code Playgroud)

java arrays

-1
推荐指数
1
解决办法
4289
查看次数