07 2019 档案

摘要:输出 解决方法: 选择编码从utf-8改为gb2312 本人小白,具体原因不知道,大家有知道的请在评论回复,多谢。 阅读全文
posted @ 2019-07-28 11:50 海底淤泥 阅读(932) 评论(0) 推荐(0) 编辑
摘要:今天使用vscode发现完整的代码报错了,但依然可以运行 错误信息: 解决方法: 在报错的地方按一下回车键,让这行不是最后一行就不报错了 报错的具体原因还不知道。有谁知道就在评论里告诉我,谢谢大家。 阅读全文
posted @ 2019-07-27 17:05 海底淤泥 阅读(1563) 评论(0) 推荐(0) 编辑
摘要:#include int main(){ int a[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; int l=sizeof(a)/4; //长度 int x=10; //要查找到的值 int Bisection(int x,int* a,int l); Bi... 阅读全文
posted @ 2019-07-22 23:56 海底淤泥 阅读(384) 评论(0) 推荐(0) 编辑
摘要:#include #include #include int main(){ int a[15]; //设立随机数 srand(time(0)); for(int i=0;ia[i+l]){ //先把当前位置的值和x交换 swap(a+i,a+i+l); ... 阅读全文
posted @ 2019-07-21 23:24 海底淤泥 阅读(177) 评论(0) 推荐(0) 编辑
摘要:#include //快速排序 int main(){ int a[]={2,1,5,4,3,8,9,6,7}; int* b=a-1+sizeof(a)/4; //基准指针 int* i=a-1; //慢指针 int* j=a; //快指针... 阅读全文
posted @ 2019-07-20 23:52 海底淤泥 阅读(180) 评论(0) 推荐(0) 编辑
摘要:package chapter3; import java.math.*; //引入数学类 //枚举类型 enum Size{SMALL,MEDIUM,LARGE}; public class D5运算符 { public static strictfp/*所有指令使用严格浮点计算*/ void main(String[] arg) { //强制转换 ... 阅读全文
posted @ 2019-07-09 23:44 海底淤泥 阅读(147) 评论(0) 推荐(0) 编辑
摘要:package chapter3; public class D3数据类型 { public static void main(String[] arg) { //Java 整型(字节数不会随硬件变化) //一byte有8位,一位存正负,剩下7位存0或1 int bytE4; short bytE2; ... 阅读全文
posted @ 2019-07-09 23:43 海底淤泥 阅读(178) 评论(0) 推荐(0) 编辑
摘要:package chapter3; public class D4变量 { public static final int BBB=100; //类常量 public static void main(String[] arg) { //变量 int a=1; int b=2; /... 阅读全文
posted @ 2019-07-09 23:43 海底淤泥 阅读(154) 评论(0) 推荐(0) 编辑
摘要:package chapter3; /** * 文档注释 *@author lp *@version 1 **/ public class D2注释 { //单行注释 /* 长注释 */ } 阅读全文
posted @ 2019-07-09 23:41 海底淤泥 阅读(170) 评论(0) 推荐(0) 编辑
摘要:package chapter3;/*有包名,命令行编译javac -d . 名字.java(注意空格)运行时用java chapter3.JavaStandard*/ public/*访问修饰符*/ class D1JavaStandard { public/*即使不写main函数也是强制public的*/ static/*Java中的main必须是静态的*/ void main... 阅读全文
posted @ 2019-07-09 23:40 海底淤泥 阅读(131) 评论(0) 推荐(0) 编辑