当前位置: 首页 > wzjs >正文

减肥药做网站营销seo网站营销推广

减肥药做网站营销,seo网站营销推广,北京西站地铁几号线,群晖nda做网站目录 一、链接 二、题目 一、链接 牛客输入输出链接:牛客网 - 找工作神器|笔试题库|面试经验|实习招聘内推,求职就业一站解决_牛客网 二、题目 1.只有输出 public class Main {public static void main(String[] args) {System.out.println("H…

目录

一、链接

二、题目


一、链接

牛客输入输出链接:牛客网 - 找工作神器|笔试题库|面试经验|实习招聘内推,求职就业一站解决_牛客网

二、题目

1.只有输出

public class Main {public static void main(String[] args) {System.out.println("Hello Nowcoder!");}
}

2.给定两个整数 a 和 b ,请你求出 a+b 的值。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);while(in.hasNextInt()){int a = in.nextInt();int b = in.nextInt();System.out.println(a+b);}}
}

3.给定若干组测试数据,读取至文件末尾为止。
每组数据有两个整数 a 和 b ,请你求出 a+b 的值。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint a = in.nextInt();int b = in.nextInt();System.out.println(a + b);}}
}

4.给定 t 组测试数据。

每组数据有两个整数 a 和 b ,请你求出 a+b 的值。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint n=in.nextInt();for(int i=0;i<n;i++){int a = in.nextInt();int b = in.nextInt();System.out.println(a + b);}}}
}

5.给定若干组测试数据,最后一组数据为 0  0 ,作为输入的结尾。

每组数据有两个整数 a 和 b ,请你求出 a+b 的值。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint a = in.nextInt();int b = in.nextInt();// 跳出本次循环if(a==0 && b==0){continue;}System.out.println(a + b);}}
}

6.给定一个长度为 n 的正整数数组 a ,第 i 个元素的值为 ai 。
请你求出数组元素之和。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint n = in.nextInt();int[] arr = new int[n];long sum = 0;for(int i=0;i<n;i++){sum += in.nextInt();}System.out.println(sum);}}
}

7.给定 tt 组询问,每次询问给出一个长度为 nn 的正整数数组 aa ,第 ii 个元素的值为 aiai​ 。
请你分别求出每个数组的元素之和。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint t = in.nextInt();for(int i=0;i<t;i++){int n = in.nextInt();long sum = 0;for(int j=0;j<n;j++){sum += in.nextInt();}System.out.println(sum);}}}
}

8.给定一个 nn 行 mm 列的二维正整数数组 aa ,第 ii 行第 jj 列元素的值为 ai,jai,j​ 。
请你求出数组元素之和。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint n = in.nextInt();int m = in.nextInt();int[][] arr = new int[n][m];long sum = 0;for(int i=0;i<n;i++){for(int j=0;j<m;j++){arr[i][j] = in.nextInt();sum+=arr[i][j];}}System.out.println(sum);}}
}

9.给定 tt 组询问,每次询问给出一个 nn 行 mm 列的二维正整数数组 aa ,第 ii 行第 jj 列元素的值为 ai,jai,j​ 。
请你分别求出每个数组的元素之和。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint t = in.nextInt();for (int k = 0; k < t; k++) {int n = in.nextInt();int m = in.nextInt();int[][] arr = new int[n][m];long sum = 0;for (int i = 0; i < n; i++) {for (int j = 0; j < m; j++) {arr[i][j] = in.nextInt();sum += arr[i][j];}}System.out.println(sum);}}}
}

10.给定一个长度为 nn 的字符串 ss ,请你将其倒置,然后输出。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNext()) { // 注意 while 处理多个 caseint n = in.nextInt();String str = in.next();StringBuilder sb = new StringBuilder(str);str = sb.reverse().toString();System.out.println(str);}}
}

11.给定 tt 组询问,每次给出一个长度为 nn 的字符串 ss ,请你将其倒置,然后输出。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNext()) { // 注意 while 处理多个 caseint t = in.nextInt();for (int i = 0; i < t; i++) {int n = in.nextInt();String str = in.next();StringBuilder sb = new StringBuilder(str);str = sb.reverse().toString();System.out.println(str);}}}
}

12.给定一个 nn 行 mm 列的二维字符数组 aa ,第 ii 行第 jj 列元素的值为 ai,jai,j​ 。
请你对行和列都倒置,然后输出之。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNext()) { // 注意 while 处理多个 caseint n = in.nextInt();int m = in.nextInt();String[] strr = new String[n];for(int i=0;i<n;i++){String str = in.next();StringBuilder sb = new StringBuilder(str);str = sb.reverse().toString();strr[i] = str;}     for(int j=strr.length-1;j>=0;j--){System.out.println(strr[j]);}}}
}

13.给定 tt 组询问,每次给出一个长度为 nn 的带空格的字符串 ss ,请你去掉空格之后,将其倒置,然后输出。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNext()) { // 注意 while 处理多个 caseint t = in.nextInt();for(int i=0;i<t;i++){int n = in.nextInt();in.nextLine();String str = in.nextLine();//  将空格替换成无nullstr = str.replaceAll(" ", "");  System.out.println(new StringBuilder(str).reverse().toString());  }}}
}

14.给定一个小数 nn ,请你保留 33 位小数后输出。
如果原来的小数位数少于 33 ,需要补充 00 。
如果原来的小数位数多于 33 ,需要四舍五入到 33 位。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNext()) { // 注意 while 处理多个 casedouble i = in.nextDouble();System.out.println(String.format("%.3f",i));}}
}

15.给定一个正整数 nn ,请你保留 99 个数位,然后输出。
如果数位少于 99 个,那么需要补充前导零。

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint a = in.nextInt();int count = 0;int t = a;while(t>0){count++;t = t/10;}if(count==9){System.out.println(a);}if(count<9){int diff = 9-count;for(int i=0;i<diff;i++){System.out.print("0");}System.out.println(a);}}}
}

16.spj判断YES与NO

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint a = in.nextInt();if(a%2==0){System.out.println("no");}else{System.out.println("Yes");}}}
}

17.spj判断浮点误差

public class Main {public static void main(String[] args) {Scanner in = new Scanner(System.in);// 注意 hasNext 和 hasNextLine 的区别while (in.hasNextInt()) { // 注意 while 处理多个 caseint a = in.nextInt();double s = 3.14 * a *a;System.out.print(s);}}
}

http://www.dtcms.com/wzjs/427681.html

相关文章:

  • 山东做网站公司广州seo搜索
  • 网站文件保护怎么做百度seo查询工具
  • 平台推广策划方案资源网站优化排名软件
  • 计算机个人网站建设论文网络营销有哪些推广平台
  • 乐都企业网站建设哪家好百度一下首页版
  • 一般网站建设步骤想学手艺在哪里可以培训
  • 广州网站建设菲利宾深圳网络营销公司
  • 网站文章内容的选取最新消息今天的新闻
  • 军博网站建设公司百度推广登录后台登录入口
  • 做标签网站是什么百度指数如何分析数据
  • wordpress 分享到微信windows优化大师是自带的吗
  • 网站建设论坛全媒体广告投放平台
  • 设计一个小型的局域网方案赣州seo外包怎么收费
  • 滕州营销型网站建设微信拓客的最新方法
  • 如何做网站源码备份淘宝代运营公司
  • 合肥高新区建设发展局网站网店推广方案
  • wordpress主题制作收费常宁seo外包
  • 高端网站开发企业怎么引流推广
  • wordpress去掉版权信息seo全网优化推广
  • 石家庄疫情是真是假网站优化要多少钱
  • 西安定制网页设计廊坊seo排名外包
  • 怎么做网站的推广十种营销方式
  • node.js做网站好累国际军事新闻最新消息视频
  • 福安 网站建设青岛百度网站排名
  • 怎么样百度能搜到自己的网站国外网站排名 top100
  • 贵州手机网站建设网络营销中的seo与sem
  • 建视频网站需要多大空间定制网站
  • 网站跳出率高的原因深圳外贸网站建设
  • 南海最新军事新闻泰安seo公司
  • 黄山网站建设电话百度一下电脑版