摘要: #include <stdio.h> int main() { char a[] = "The quick brown fox jumps over the lazy dog."; a[4] = '\0'; //a[] = "The \0uick brown fox jumps over the l 阅读全文
posted @ 2020-05-26 10:18 profesor 阅读(917) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> //找出一维数组中最大最小的数 int max(int *array, int len); //原型声明 int min(int *array, int len); //原型声明 int main() { int a[] = {1, 2, 4, 7, 10, 1 阅读全文
posted @ 2020-05-26 10:03 profesor 阅读(629) 评论(0) 推荐(0) 编辑
摘要: 一维数组的创建方法 //第一种创建array的方法: String[] familyMembers = new String[4]; familyMembers[0] = "jerry"; familyMembers[1] = "elaine"; familyMembers[2] = "george 阅读全文
posted @ 2020-05-25 22:45 profesor 阅读(629) 评论(0) 推荐(0) 编辑
摘要: public class Arrays { public static void main(String[] args) //返回值设为String { for (String name : names()) System.out.println(name); } public static Str 阅读全文
posted @ 2020-05-25 22:40 profesor 阅读(175) 评论(0) 推荐(0) 编辑
摘要: //一维随机数组 public class RandomArray { public static void main(String[] args) { int[] nums = new int[(int) (Math.random() * 10)]; System.out.println("len 阅读全文
posted @ 2020-05-25 22:08 profesor 阅读(785) 评论(0) 推荐(0) 编辑
摘要: //我们知道: Java有Math.random()来随机选择[0,1)内的任意数 //随机取数 // import java.util.Random; public class Choice { public static void main(String[] args) { Random rdm 阅读全文
posted @ 2020-05-25 21:56 profesor 阅读(2680) 评论(0) 推荐(0) 编辑
摘要: Array of arrays: #include <stdio.h> #include <string.h> int main() { char tracks[][100] = { "will the protesters in American cities bring progress", " 阅读全文
posted @ 2020-05-25 16:27 profesor 阅读(177) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash for item in * do if [ -f $item ] then echo $item fi done for do done if then (elif...then...) (else) fi 阅读全文
posted @ 2020-05-24 22:53 profesor 阅读(94) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; public class Reader { public static void main(String[] args) { Scanner scan = new Scanner(System.in); //创建对象 System.out.prin 阅读全文
posted @ 2020-05-24 22:45 profesor 阅读(406) 评论(0) 推荐(0) 编辑
摘要: import static java.lang.System.out; public class hello { public static void main(String[] args) { boolean bool = false; while (false) //这里如果直接换成while 阅读全文
posted @ 2020-05-24 22:29 profesor 阅读(214) 评论(0) 推荐(0) 编辑