10.20作业

1

public class Example2_1 {
    public static void main(String[] args) {
        char ch1='w',ch2='好';
        int p1=32831,p2=30452;
        System.out.println("\""+ch1+"\"的位置:"+(int)ch1);
        System.out.println("\""+ch2+"\"的位置:"+(int)ch2);
        System.out.println("第"+p1+"个位置上的字符是:"+(char)p1);
        System.out.println("第"+p2+"个位置上的字符是:"+(char)p2);
    }
}

2

public class Example2_2 {
    public static void main(String[] args) {
        byte b= 22;
        int n=129;
        float f=123456.6789f;
        double d=123456789.123456789;
        System.out.println("b= "+b);
        System.out.println("n= "+n);
        System.out.println("f= "+f);
        System.out.println("d= "+d);
        b=(byte)n;
        f=(float)d;
        System.out.println("b= "+b);
        System.out.println("f= "+f);
    }
}
import java.util.Scanner;

3

public class Example2_3 {
    public static void main(String[] args) {
        System.out.println("用空格(或回车)做分隔,输入若干个数,最后输入#结束,\n然后回车确认.");
        Scanner reader = new Scanner(System.in);
        double sum = 0;
        int m = 0;
        while(reader.hasNextDouble()){
            double x = reader.nextDouble();
            m = m + 1;
            sum = sum + x;
        }
        System.out.println(m +"个数的和为"+sum);
        System.out.println(m +"个数的平均值"+sum/m);
    }
}

4

public class Example2_4 {
    public static void main(String[] args) {
        int a[] = {1,2,3,4};
        int b[] = {100,200,300};
        System.out.println("数组a的元素个数="+a.length);
        System.out.println("数组b的元素个数="+b.length);
        System.out.println("数组a的引用="+ a);
        System.out.println("数组b的引用="+ b);
        System.out.println("a==b的结果是"+ (a==b));
        a=b;
        System.out.println("数组a的元素个数="+a.length);
        System.out.println("数组b的元素个数="+b.length);
        System.out.println("a==b的结果是"+ (a==b));
        System.out.println("a[0]="+a[0]+",a[1]="+a[1]+",a[2]="+a[2]+);
        System.out.println("b[0]="+b[0]+",b[1]="+b[1]+",b[2]="+b[2]+);
    }
}
import java.util.Arrays;

5

public class Example2_5 {
    public static void main(String args[]){
        char [] a = {'a','b','c','d','e','f'},
                b = {'1','2','3','4','5','6'};
        int[] c ={1,2,3,4,5,6},
                d = {10,20,30,40,50,60};
        System.arraycopy(a,0,b,0,a.length);
        System.arraycopy(c,2,d,2,c.length-3);
        System.out.println("数组a的各个元素中的值:");
        System.out.println(Arrays.toString(a));
        System.out.println("数组b的各个元素中的值:");
        System.out.println(Arrays.toString(b));
        System.out.println("数组c的各个元素中的值:");
        System.out.println(Arrays.toString(c));
        System.out.println("数组d的各个元素中的值:");
        System.out.println(Arrays.toString(d));
    }
}
import java.util.Arrays;

6

public class Example2_6 {
    public static void main(String args[]){
        int [] a ={10,20,30,40,50,60},b,c,d;
        b= Arrays.copyOf(a,10);
        System.out.println("数组a的各个元素中的值:");
        System.out.println(Arrays.toString(a));
        System.out.println("数组b的各个元素中的值:");
        System.out.println(Arrays.toString(b));
        c=Arrays.copyOfRange(a,3,5);
        System.out.println("数组c的各个元素中的值:");
        System.out.println(Arrays.toString(c));
        d=Arrays.copyOfRange(a,3,9);
        System.out.println("数组d的各个元素中的值:");
        System.out.println(Arrays.toString(d));
    }
}
import java.util.Arrays;

7

public class Example2_7 {
    public static void main(String args[]){
        int [] a = {12,34,45,6,45,90,123,19,34};
        Arrays.sort(a);
        System.out.println(Arrays.toString(a));
        int number=45;
        int index= Arrays.binarySearch(a,number);
        if(index>=0){
            System.out.println(number+"和数组中索引为"+index+"的元素相同");
        }
        else{
            System.out.println(number+"不与数组中任何元素值相同");
        }
    }
}
import java.util.Scanner;
    enum Season {
        春季,夏季,秋季,冬季
    }

8

 public class Example2_8 {
        public static void main(String args[]){
            Season x = null;
            Scanner reader=new Scanner(System.in);
            int n = reader.nextInt();
            if (n == 1)
                x = Season.春季;
            else if(n == 2)
                x = Season.夏季;
            else if(n == 3)
                x = Season.秋季;
            else if(n == 4)
                x = Season.冬季;
            System.out.println("现在是"+x);
        }
}

9

public class Example2_9 {
    public static void main(String args[]){
        Weekday x= Weekday.星期日;
        if(x==Weekday.星期日){
            System.out.println(x);
            System.out.println("今天我休息");
        }
    }
}

ContextCapture 10.20是一个软件程序,用于进行地理数据的捕捉和处理。安装ContextCapture 10.20需要按照以下步骤进行操作:首先,安装主程序。其次,在安装完成后,需要打补丁来确保软件的正常运行。最后,安装中文包以方便使用中文界面。 如果您已经完成了安装,可以在桌面上找到软件ContextCapture Center Master,并打开文件安装的位置。接下来,您需要将数据中提供的bentley.entliclib.dll文件放到该目录下,以替换原文件。 如果您还没有下载软件,请先准备好软件包数据。您可以在提供的链接中下载ContextCapture 10.20的软件包数据,并使用提取码进行解压。然后运行CCCenter-10.20.0.4117.x64-en文件来开始安装。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [【CC精品教程】ContextCapture 10.20安装教程(附CC10.20安装包下载)](https://blog.csdn.net/lucky51222/article/details/132390301)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [【板栗糖GIS】CC—ContextCapture10.20的安装教程](https://blog.csdn.net/weixin_46192906/article/details/127230148)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值