当前位置:网站首页>[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
边栏推荐
- 【每日一题】第二天
- Server PHP environment building tutorial, PHP server environment building graphic explanation
- 第一次去曼谷旅游怎么玩?这份省钱攻略请收好
- CDN acceleration and breaking J anti-theft chain function
- 如何设置VSCode删除整行快捷键?
- 电商系统中常见的 9 大坑,你踩过没?
- UML 类图
- Installation of thingsboard, an open source IOT platform
- Introduction to sap s/4hana OData mock service
- C语言中函数参数传递的三种方式
猜你喜欢

Web version 3D visualization tool, 97 things programmers should know, AI frontier paper | information daily # 2022.07.01

Leetcode 面试题 17.01. 不用加号的加法

Comprendre complètement le tutoriel de traitement de Point Cloud basé sur open3d!

Esp32-c3 introductory tutorial question ⑩ - error: implicit declaration of function 'ESP_ blufi_ close‘;

全链路数字化转型下,零售企业如何打开第二增长曲线

故障排查:kubectl报错ValidationError: unknown field \u00a0

第一次去曼谷旅游怎么玩?这份省钱攻略请收好

UE4 用spline畫正圓

科技公司不同人对Bug的反应 | 每日趣闻

材质UV遮罩的技巧
随机推荐
iptable端口重定向 MASQUERADE[通俗易懂]
Is it safe to buy funds on Alipay account
[Yugong series] July 2022 go teaching course 001 introduction to go language premise
Unity learning shader notes [82] black and white processing of enhanced single channel color rendering
MySQL 关于 only_full_group_by 限制
Websocket of Web real-time communication technology
LightGroupButton* sender = static_ cast<LightGroupButton*>(QObject::sender());
Leetcode 面试题 16.15. 珠玑妙算
The difference between promise and observable
Meal card hdu2546
如何设置VSCode删除整行快捷键?
C语言中函数参数传递的三种方式
工业软件讲堂-三维CAD设计软件的核心技术解析----讲坛第二次讲座
Redis (6) -- object and data structure
Web实时通信技术之Websocket
Hongmeng's fourth learning
In early summer, Kaiyuan magic changed an electric mosquito racket with killing sound effect!
“栈”的典型应用—表达式求值(C语言实现)
Leetcode interview question 16.11 Diving board
Troubleshooting ideas that can solve 80% of faults