摘要: 、给定一个有9个整数(1,6,2,3,9,4,5,7,8)的数组,先排序,然后输出排序后的数组的值。 package shuzuDemo; import java.util.Arrays; public class work01 { public static void main(String[] 阅读全文
posted @ 2023-06-27 20:24 淘气5555 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 编写一个简单程序,要求数组长度为5,静态赋值10,20,30,40,50,在控制台输出该数组的值 package shuzudemo01; public class Text01 { public static void main(String[] args) { // TODO Auto-gene 阅读全文
posted @ 2023-06-27 20:23 淘气5555 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 使用for循环计算1-100的和,除了以3结尾的那些数 package Text; public class text01 { public static void main(String[] args) { // TODO Auto-generated method stub int i; int 阅读全文
posted @ 2023-06-27 20:22 淘气5555 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1. 分别使用for循环,while循环,do循环求1到100之间所有能被3整除的整数的和。(知识点:循环语句) package a; public class aaa { public static void main(String[] args) { int sum=0; for(int i=1 阅读全文
posted @ 2023-06-27 20:21 淘气5555 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1 输入年份月份,输出该月的天数(闰年2月29天,条件参考上机练习1) package aaa; import java.util.Scanner; public class A { public static void main(String[] args) { Scanner input=new 阅读全文
posted @ 2023-06-27 20:20 淘气5555 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 1. 定义圆形半径,求面积。int r =5; package 难得; import java.util.Scanner; public class 无语 { public static void main(String[] args) { // TODO Auto-generated method 阅读全文
posted @ 2023-06-27 20:19 淘气5555 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1.实现一个菜单 可以切换 ,可以返回主菜单 主菜单 1.登录 2.注册 3.输出水仙花数 4.退出程序 请选择: 选择后实现对应的功能 #include<stdio.h> void mainMenu(); void two(); main() { mainMenu(); } void mainMe 阅读全文
posted @ 2021-12-09 10:55 淘气5555 阅读(41) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> main() { char a[20]; int i=0,lenth=0; printf("请输入字符"); scanf("%s",a); while(a[i++]!='\0'){ lenth++; } printf("字符串的长度为%d",lenth); } 2 阅读全文
posted @ 2021-12-09 10:54 淘气5555 阅读(55) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> main() { int a[8],i; for(i=0;i<8;i++) { scanf("%d",&a[i]); } printf("逆序输出后\n"); for(i=7;i>=0;i--) { printf("%d\n",a[i]); } } 2.使用一维数 阅读全文
posted @ 2021-12-09 10:53 淘气5555 阅读(27) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include <stdlib.h> #include <time.h> int main() { while(1) { int a=0,b; srand((unsigned)time(NULL)); a = rand()%100+1; printf("请输入一 阅读全文
posted @ 2021-12-09 10:52 淘气5555 阅读(25) 评论(0) 推荐(0) 编辑