摘要: 1 /*题目:小芳的妈妈每天给她2.5元,她都会存起来, 2 但是,每当这一天是存钱的第五题或者5的倍数的话, 3 她都会去用掉6块钱。 4 问:至少经过多少天可以存到100块? 5 */ 6 /*分析 7 * 每天增加2.5,直到存够100就不增了——while 8 * 如果天数是5的倍数就话掉6 阅读全文
posted @ 2020-03-05 20:58 浪漫主义程序员 阅读(2684) 评论(0) 推荐(0) 编辑
摘要: 1 import java.util.Scanner; 2 3 public class Question1 { 4 public static void main(String[] args) { 5 //从键盘得到想要输出多大规模的乘法表 6 System.out.println("请输入n:" 阅读全文
posted @ 2020-03-05 20:56 浪漫主义程序员 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 1 public class Question5 { 2 public static void main(String[] args) { 3 //声明一个满足条件整数型数组(6和0一次) 4 int[] a = {1, 2, 3, 4, 5, 1, 6, 2, 7, 3, 8, 4, 9, 5, 阅读全文
posted @ 2020-03-04 19:35 浪漫主义程序员 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1 public class Question4 { 2 public static void main(String[] args) { 3 //声明一段字符串存入字符串数组中(好像8满足) 4 char[] str={'a','d','g','f','e','z','8','9','a','d' 阅读全文
posted @ 2020-03-04 19:32 浪漫主义程序员 阅读(398) 评论(1) 推荐(0) 编辑
摘要: 1 public class Question2 { 2 public static void main(String[] args) { 3 //从键盘得到一个五位正整数 4 Scanner sc = new Scanner(System.in); //new一个标准输入流 5 System.ou 阅读全文
posted @ 2020-03-04 19:30 浪漫主义程序员 阅读(744) 评论(0) 推荐(0) 编辑
摘要: 1 import java.util.Scanner; 2 3 public class Question1 { 4 public static void main(String[] args) { 5 //从键盘得到一个值 6 Scanner sc = new Scanner(System.in) 阅读全文
posted @ 2020-03-04 19:25 浪漫主义程序员 阅读(2139) 评论(0) 推荐(0) 编辑
摘要: 1 public class SixteenToTen { 2 public static void main(String[] args) { 3 //用数组得到要转换的值 4 char[] a={'e','f'}; 5 //声明一个整型数组接收数组转化过来的值 6 int[] b=new int 阅读全文
posted @ 2020-03-04 19:22 浪漫主义程序员 阅读(1485) 评论(0) 推荐(0) 编辑
摘要: 1 public class EightToTen { 2 public static void main(String[] args) { 3 //得到要转换的值 4 int n=345; 5 //声明一个x得到转化后的值 6 long x=0; 7 //声明count 来统计此时的基为多少 8 阅读全文
posted @ 2020-03-04 19:21 浪漫主义程序员 阅读(825) 评论(0) 推荐(0) 编辑
摘要: 1 package com.scwyqin.Transition; 2 3 /* 4 * @author:scwyqin 5 * @date: 2020-3-2 19:21 6 */ 7 8 import java.util.Scanner; 9 10 public class Transition 阅读全文
posted @ 2020-03-04 19:20 浪漫主义程序员 阅读(1018) 评论(0) 推荐(0) 编辑
摘要: 1 /*37 【程序 37 报数】 2 题目:有 n 个人围成一圈,顺序排号。从第一个人开始报数(从 1 到 3 报数),凡报到 3 的人退出圈子, 3 问最后留下的是原来第几号的那位。 4 */ 5 6 /*分析1 错误分析,没有注意到要退出圈子!!! 7 * 1、用一个数组存放n个1,从头开始报 阅读全文
posted @ 2020-02-20 01:40 浪漫主义程序员 阅读(996) 评论(0) 推荐(0) 编辑