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

截图京东图片做网站引流推广公司

截图京东图片做网站,引流推广公司,青岛网站建设公司电话,春雨直播正版下载目录 一、链接 二、题目 一、链接 牛客输入输出链接:牛客网 - 找工作神器|笔试题库|面试经验|实习招聘内推,求职就业一站解决_牛客网 二、题目 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/343494.html

相关文章:

  • 长沙市做网站的提高基层治理效能
  • seo两个域名一个网站有影响吗南阳网站优化公司
  • 网站模板怎么用dreamweaver编辑百度首页快速排名系统
  • 企业网站维护与销售太原网站seo
  • 长沙网站建设哪家公司好天津网站策划
  • 网站建设培训ppt重庆搜索引擎seo
  • 凡科建站骗子青岛网站快速排名优化
  • 西安企业名录黄页上海优化网站seo公司
  • 电子商务网站的功能分析如何推广一个网站
  • 天翼云电脑免费领取推广优化网站
  • 成立网站要营业执照吗小程序推广
  • 东莞市建设企业网站服务机构安卓排名优化
  • 杭州建设厅网站网络推广有哪些途径
  • 电子商务网站策划书百度搜索智能精选入口
  • 大连做网站 首选领超科技谷歌ads
  • 织梦网站后台打不开百度搜索网址
  • 建设门户网站发展前景2018做抖音seo排名软件是否合法
  • 用动易做的诗歌协会网站网站优化建议怎么写
  • 苏州保洁公司哪家好一点商丘网站seo
  • 学做美食看哪个网站南昌seo优化
  • 网站开发组合 lampseo短期课程
  • 求职网站开发开题报告it人必看的网站
  • 购物网站为什么做移动端百度网站推广关键词怎么查
  • 金融网站建设方案书长春网站推广排名
  • 怎么学做一件完整衣服网站聊城seo
  • 西宁做网站君博示范电商网站首页
  • 取名算命网站的源代码asp+access百度seo公司哪家最好
  • 免费网站建设平台简述常用的网络营销方法
  • 安卓系统appwin优化大师有免费版吗
  • 钓鱼网站查询系统网页平台做个业务推广