当前位置:网站首页>[daily question] first day
[daily question] first day
2022-07-02 18:50:00 【No. 101 of the top 100 most handsome faces in the Asia Pacific 】
️ Author: intellectuals
️ Personal blog : Old nine CSDN Blog
Personal famous saying : Uncontrollable things Optimistic face
Series column : A daily topic
List of articles
choice
Character Is a wrapper class , Cannot store string constants ,String Sure ,StringBuffer need new Objects can only be used ,Vector Is a collection
Method rewrite : There is an inheritance relationship , The method parent class required by the subclass cannot meet , The permission size of subclass method override must be greater than that of the parent class , Everything else is the same
Principles of structured programming : modularization , The top-down , Progressive refinement
The member variable is not initialized and defaults to 0
java The remainder can take decimals ,C Language doesn't work
Only static methods can be accessed with class names
Programming questions 1
The grouping method can be sorted from small to large , Then take the first and last two to form a group
The formula :arr.len-2*(i+1)
public class test1 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNextInt()) {
int n = scan.nextInt();
int[] array = new int[3 * n];
long sum = 0;
for (int i = 0; i < 3 * n; i++) {
array[i] = scan.nextInt();
}
Arrays.sort(array);
for (int i = 0; i < n; i++) {
sum += array[array.length - 2 * (i + 1)];
}
System.out.println(sum);
}
}
}
Programming questions 2
1. Traverse str2 This string , Put the corresponding characters in hash[]
2. Traverse str1, find == 0 Is the character you want
public class test1 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String str1 = scan.nextLine();
String str2 = scan.nextLine();
HashMap<Character,Integer> map = new HashMap();
for(int i = 0;i<str2.length();i++){
if(map.get(str2.charAt(i)) == null){
map.put(str2.charAt(i),1);
}else{
map.put(str2.charAt(i),map.get(str2.charAt(i))+1);
}
}
String ret = "";
for(int i = 0;i< str1.length();i++){
if(map.get(str1.charAt(i)) == null){
ret += str1.charAt(i);
}
}
System.out.println(ret);
}
}
————————————————————————
It's not easy to code words , Everyone's support is my driving force to stick to it
Copyright notice : This paper is about CSDN Blogger 「 The top 100 most handsome faces in the Asia Pacific region 101 name 」 The original article of
边栏推荐
- options should NOT have additional properties
- Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future
- What are the links of the problem
- SQL training 2
- UE4 用spline画正圆
- Singapore summer tourism strategy: play Singapore Sentosa Island in one day
- 夜神模擬器+Fiddler抓包測試App
- Use MNIST in tensorflow 2_ 784 data set for handwritten digit recognition
- Redis (7) -- database and expiration key
- 任职 22 年,PowerShell 之父将从微软离职:曾因开发 PowerShell 被微软降级过
猜你喜欢
27:第三章:开发通行证服务:10:【注册/登录】接口:注册/登录OK后,把用户会话信息(uid,utoken)保存到redis和cookie中;(一个主要的点:设置cookie)
Web version 3D visualization tool, 97 things programmers should know, AI frontier paper | information daily # 2022.07.01
UE4 用spline畫正圓
Another double non reform exam 408, will it be cold? Software College of Nanchang Aviation University
M2dgr: slam data set of multi-source and multi scene ground robot (ICRA 2022)
Relax again! These fresh students can settle directly in Shanghai
NM01-独立于总线协议的NM模块功能概述与API定义
第一次去曼谷旅游怎么玩?这份省钱攻略请收好
Leetcode interview question 16.15 Abacus wonderful calculation
Yesterday, Alibaba senior wrote a responsibility chain model, and there were countless bugs
随机推荐
“栈”的典型应用—表达式求值(C语言实现)
Server PHP environment building tutorial, PHP server environment building graphic explanation
Yesterday, Alibaba senior wrote a responsibility chain model, and there were countless bugs
Night God simulator +fiddler packet capture test app
Leetcode(154)——寻找旋转排序数组中的最小值 II
快速排序基本思路(通俗易懂+例子)「建议收藏」
Redis(7)----数据库与过期键
The text editor hopes to mark the wrong sentences in red, and the text editor uses markdown
深度神经网络总结
PR曲线和ROC曲线概念及其区别
Esp32-c3 introductory tutorial question ⑪ - ESP tls: create_ ssl_ handle failed, tls_ io_ instance->options. trusted_ certs null
Tips for material UV masking
What is cloud primordial? This time, I can finally understand!
【每日一题】第二天
SLC、MLC、TLC 和 QLC NAND SSD 之间的区别:哪个更好?
开源物联网平台ThingsBoard的安装
Redis (6) -- object and data structure
Which securities company has a low, safe and reliable online account opening commission
[Yugong series] July 2022 go teaching course 001 introduction to go language premise
Radian to angle, angle to radian in MATLAB