当前位置:   article > 正文

蓝桥杯 第九届蓝桥杯Java语言C组_xjjo

xjjo

题目标签

12345
哪天返回猴子分香蕉字母阵列第几个幸运数书号验证
678910
打印大X缩位求和等腰三角形小朋友崇拜圈耐摔指数

1.哪天返回

11

  1. package 哪天返回;
  2. public class Main {
  3. public static void main(String[] args) {
  4. int money = 1;
  5. int sum = 0;
  6. for (int i = 1; ; i++,money+=2) {
  7. sum+=money;
  8. System.err.println("第"+i+"天 :"+sum);
  9. if (sum >= 108) {
  10. break;
  11. }
  12. }
  13. }
  14. }

2.猴子分香蕉

  1. package 猴子分香蕉;
  2. public class Main {
  3. public static void main(String[] args) {
  4. for (int i = 17; i < 1000000; i++) {
  5. int num = i;
  6. if (num % 5 == 1) {
  7. num=num-1;
  8. num -= (num/5);
  9. if (num%5==2) {
  10. num -= 2;
  11. num -= (num/5);
  12. if (num%5==3) {
  13. num-=3;
  14. num -=(num/5);
  15. if (num%5==4) {
  16. num-=4;
  17. num-=(num/5);
  18. if (num%5==0) {
  19. System.out.println(i);
  20. return;
  21. }
  22. }
  23. }
  24. }
  25. }
  26. }
  27. }
  28. }

3.字母阵列

  1. FOAIQNALWIKEGNICJWAOSXDHTHZPOLGYELORAUHOHCZIERPTOOJUITQJCFNIYYQHSBEABBQZPNGYQTCLSKZFCYWDGOAIADKLSNGJ
  2. GSOZTQKCCSDWGUWAUOZKNILGVNLMCLXQVBJENIHIVLRPVVXXFTHQUXUAVZZOFFJHYLMGTLANQIAOQQILCDCJERJASNCTLYGRMHGF
  3. TSDFYTLVIBHKLJVVJUDMKGJZGNNSTPVLCKTOFMUEUFSVQIAUVHNVFTGBDDARPKYNNCUOYUAZXQJNOEEYKLFRMOEMHUKJTPETHLES
  4. FKVINSLWEVGAGMKVFVIUBMYOIAFHLVNKNTYKTZWVXQWRWIGPENFXYDTKRVPKRTHMGHVYOCLDCKMEKRLGEKBYUCLOLYPAKPFSOREH
  5. KWPUOLOVMOFBIXYACWRDYBINTMPASPCEOKHXQIGBQ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RHDSTWXDIWGRVMLIJFBWHLHCDAAVUDLZSCGQNOUXVUIVIZZZMD
  98. NMHGYPFUUDWKQGTAKKGCDFJFYJFNRZVXDPGZEAMWQVQZODKTXHIYFVKJSSAWVHYCUCZMLLBPXTILDYJQEMWDRUFKISOUVPUDTYPB
  99. FDAQUBXHUJYTAYNWVIJNUSQDTQDEMUAPWXRYUWONTBDZCHZOUEGPMWEZTQWWSHAYOBWVTDIMZYNVNZKUHOFCQKPHJXWNRCGUJEKO
  100. WSDAUGUTVWCVHEMOIRJJGTANUWTSAIXXEVZTBDHPGSRHHVWCDZVZYRJTLONIJVXEATHQXOUKBIGZONFRSZIOGWNTYAJYLQCGEOWY

41

  1. package 字母阵列;
  2. import java.util.Scanner;
  3. public class Main {
  4. static int count = 0;
  5. public static void main(String[] args) {
  6. Scanner sr = new Scanner(System.in);
  7. //创建地图
  8. char[][] map = new char[100][100];
  9. for (int i = 0; i < map.length; i++) {
  10. String s = sr.next();
  11. map[i] = s.toCharArray();
  12. }
  13. //寻找L起点
  14. for (int i = 0; i < map.length; i++) {
  15. for (int j = 0; j < map[0].length; j++) {
  16. dfs(i, j, map);//以此位置为起点
  17. }
  18. }
  19. System.out.println(count);
  20. }
  21. private static void dfs(int i, int j, char[][] map) {
  22. //LANQIAO
  23. String Model = "LANQIAO";
  24. //方向移动数组
  25. int[] dx = {1,-1,0,0,-1,-1,1,1};
  26. int[] dy = {0,0,-1,1,-1,1,-1,1};
  27. for (int k = 0; k < 8; k++) {
  28. int nx = i;//起点位置
  29. int ny = j;
  30. int step = 0;//字符匹配计数器
  31. //按此方向循环蓝桥长度
  32. for (int p = 0; p < Model.length(); p++) {
  33. nx += dx[k];
  34. ny += dy[k];
  35. if (nx >= 0 && ny >= 0 && nx < map.length && ny < map[0].length && map[nx][ny] == Model.charAt(p)) {
  36. step++;
  37. continue;
  38. }else {
  39. break;
  40. }
  41. }//此方向完美匹配长度,count++;
  42. if (step == Model.length()) count++;
  43. }
  44. return;
  45. }
  46. }

4.第几个幸运数

1905

  1. package 第几个幸运数;
  2. public class Main {
  3. public static void main(String[] args) {
  4. // 统计最后的幸运数
  5. int count = 0;
  6. // 数字太大所以用Long型,数字最后+L表示形式!!因为JAVA默认int类型~
  7. Long num = 59084709587505L;
  8. for (int i = 0; Math.pow(3, i) < num; i++) { // 3的i次方<num
  9. for (int j = 0; Math.pow(5, j) < num; j++) { // 5的j次方<num
  10. for (int k = 0; Math.pow(7, k) < num; k++) { // 7的k次方<num
  11. if (Math.pow(3, i) * Math.pow(5, j) * Math.pow(7, k) <= num) { // 如果三个次方同时相乘<num,继续循环!!
  12. count++; // 求得幸运数结果
  13. }
  14. }
  15. }
  16. }
  17. // 千万注意,因为i,j,k的for初始值为0,0没有意义,所以在原结果-1,求得答案1905!!
  18. System.out.println(count - 1);
  19. }
  20. }

5.书号验证

  1. package 书号验证;
  2. public class Main
  3. {
  4. static boolean f(String s){
  5. int k=1;
  6. int sum = 0;
  7. for(int i=0; i<s.length(); i++){
  8. char c = s.charAt(i);
  9. if(c=='-' || c==' ') continue;
  10. sum += (c-'0')*(k%2==0?3:1); //填空
  11. k++;
  12. if(k>12) break;
  13. }
  14. return s.charAt(s.length()-1)-'0' == (10-sum % 10)%10;
  15. }
  16. public static void main(String[] args){
  17. System.out.println(f("978-7-301-04815-3"));
  18. System.out.println(f("978-7-115-38821-6"));
  19. }
  20. }

6.打印大X

  1. package 打印大X;
  2. public class Main
  3. {
  4. static void f(int h, int w){
  5. System.out.println(String.format("高度=%d, 笔宽=%d",h,w));
  6. int a1 = 0;
  7. int a2 = h - 1;
  8. for(int k=0; k<h; k++){
  9. int p = Math.min(a1,a2);
  10. int q = Math.max(a1+w,a2+w);
  11. for(int i=0; i<p; i++) System.out.print(" ");
  12. if(q-p<w*2){
  13. for(int i = p ; i < q ;i++)System.out.print("*"); ; //填空
  14. }
  15. else{
  16. for(int i=0; i<w; i++) System.out.print("*");
  17. for(int i=0; i<q-p-w*2; i++) System.out.print(" ");
  18. for(int i=0; i<w; i++) System.out.print("*");
  19. }
  20. System.out.println();
  21. a1++;
  22. a2--;
  23. }
  24. }
  25. public static void main(String[] args){
  26. f(15,3);
  27. f(8,5);
  28. }
  29. }

7.缩位求和

  1. package 缩位求和;
  2. import java.util.Scanner;
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner sr = new Scanner(System.in);
  6. String s = sr.next();
  7. while (s.length() > 1) {
  8. int num = 0;
  9. for (int i = 0; i < s.length(); i++) {
  10. num += s.charAt(i)-'0';
  11. }
  12. s = num+"";
  13. }
  14. System.out.println(s);
  15. }
  16. }

8.等腰三角形

  1. 例如:
  2. 输入:
  3. 5
  4. 程序应该输出:
  5. ....1
  6. ...2.1
  7. ..3...2
  8. .4.....1
  9. 567891011
  10. 再例如:
  11. 输入:
  12. 10
  13. 程序应该输出:
  14. .........1
  15. ........2.2
  16. .......3...2
  17. ......4.....2
  18. .....5.......1
  19. ....6.........2
  20. ...7...........0
  21. ..8.............2
  22. .9...............9
  23. 1011121314151617181
  24. 再例如:
  25. 输入:
  26. 15
  27. 程序应该输出:
  28. ..............1
  29. .............2.3
  30. ............3...2
  31. ...........4.....3
  32. ..........5.......1
  33. .........6.........3
  34. ........7...........0
  35. .......8.............3
  36. ......9...............9
  37. .....1.................2
  38. ....0...................8
  39. ...1.....................2
  40. ..1.......................7
  41. .1.........................2
  42. 21314151617181920212223242526
  43. 资源约定:
  44. 峰值内存消耗(含虚拟机) < 256M
  45. CPU消耗 < 1000ms
  1. package 数字三角形;
  2. import java.util.Scanner;
  3. public class Main {
  4. public static void main(String[] args) {
  5. Scanner sr = new Scanner(System.in);
  6. int n =sr.nextInt();
  7. String str = "";
  8. for (int i = 1; i <= n*2+3; i++) {
  9. str += i;
  10. }
  11. //计算整个字串长度
  12. int len = ( n-1 ) + ( n*2-1 ) + ( n-2 );
  13. str = str.substring(0,len);
  14. String left = str.substring(0,(n-1));
  15. String down = str.substring((n-1) ,(n-1) + (n*2-1));
  16. String right = str.substring((n-1) + (n*2-1) , len);
  17. right = new StringBuilder(right).reverse().toString();
  18. // System.out.println(left);
  19. // System.out.println(down);
  20. // System.out.println(right);
  21. //行
  22. for (int j = n-1; j >= 1; j--)
  23. System.out.print(".");
  24. System.out.println(left.charAt(0));
  25. for (int i = 2; i < n; i++) {
  26. //输出前置*
  27. for (int j = n-i; j >= 1; j--)
  28. System.out.print(".");
  29. //左
  30. System.out.print(left.charAt(i-1));
  31. //输出中间*
  32. for (int j = 1; j <= i-2; j++)
  33. System.out.print("..");
  34. System.out.print(".");
  35. //右
  36. System.out.println(right.charAt(i-2));
  37. }
  38. System.out.println(down);
  39. }
  40. }

9.小朋友崇拜圈

  1. package 小朋友崇拜圈;
  2. import java.util.ArrayList;
  3. import java.util.Scanner;
  4. public class Main {
  5. public static void main(String[] args) {
  6. Scanner sr = new Scanner(System.in);
  7. int n = sr.nextInt();
  8. int max = 0;//最大值圈
  9. int[] child = new int[n+1];//存储小朋友崇拜的人,序号1开始,所以+1
  10. for (int i = 1; i < child.length; i++) {
  11. child[i] = sr.nextInt();
  12. }
  13. //遍历起点
  14. for (int i = 1; i < child.length; i++) {
  15. //从这个起点开始寻找崇拜圈
  16. ArrayList<Integer> list = new ArrayList<Integer>();
  17. list.add(i);
  18. while (!list.isEmpty()) {
  19. //看看刚加进来的小朋友崇拜谁
  20. int id = child[list.get(list.size()-1)];
  21. //这个人之前被崇拜你的人崇拜过,形成圈
  22. if (list.contains(id)) {
  23. System.out.print(list+" ");
  24. System.out.println(list.size() - list.indexOf(id));
  25. max = Math.max(max, list.size() - list.indexOf(id));
  26. break;
  27. }//寻找新加进来的整个人崇拜的人
  28. list.add(id);
  29. }
  30. }
  31. System.out.println(max );
  32. }
  33. }

10.耐摔指数

  1. package 耐摔次数;
  2. public class Main {
  3. public static void main(String[] args) {
  4. int[][] dp = new int[1000+1][3+1];
  5. //手机数量为1时的测试次数了
  6. for (int i = 1; i < dp.length; i++) {
  7. dp[i][1] = i;
  8. }
  9. for (int i = 1; i < dp.length; i++) {
  10. //由于上面已经设置了手机数量为1时的测试次数了
  11. //所以只需从手机数量为2开始进行遍历即可
  12. for (int j = 2; j < dp[0].length; j++) {
  13. //取一个不影响结果的数
  14. int min = Integer.MAX_VALUE;
  15. //从第1层到第 i 层,逐一尝试所有决策,取最优的
  16. //每一层最坏情况下(max 测试次数最多)的最好结果(min)
  17. for (int k = 1; k <= i; k++) {
  18. min = Math.min(min,
  19. Math.max(dp[k-1][j-1], dp[i-k][j]));
  20. }
  21. //需要加上本次测试的次数,因此需要+1
  22. dp[i][j]=min+1;
  23. }
  24. }
  25. System.out.println(dp[1000][3]);
  26. }
  27. }

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/73656
推荐阅读
相关标签
  

闽ICP备14008679号