当前位置:网站首页>牛客基础语法必刷100题之基本类型
牛客基础语法必刷100题之基本类型
2022-07-07 22:54:00 【InfoQ】
牛客基础语法必刷100题之基本类型
BC3 牛牛学说话之-整数
描述
输入描述:
输出描述:
示例1
3
3
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
System.out.println(a);
}
}
BC4 牛牛学说话之-浮点数
描述
输入描述:
输出描述:
示例1
1.359578
1.360
import java.util.Scanner;
public class Main{
public static void main(String[] args){
float a;
Scanner sc=new Scanner(System.in);
a=sc.nextFloat();
System.out.println(String.format("%.3f",a));
}
}
BC5 牛牛学说话之-字符
描述
输入描述:
输出描述:
示例1
a
a
import java.util.Scanner;
public class Main{
public static void main(String[] args){
String c;
Scanner sc=new Scanner(System.in);
c=sc.nextLine();
System.out.println(c);
}
}
BC6 牛牛的第二个整数
描述
输入描述:
输出描述:
示例1
1 2 3
2
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner in=new Scanner(System.in);
int a[]=new int[3];
for(int i=0;i<a.length;i++){
a[i]=in.nextInt();
}
System.out.println(a[1]);
}
}
边栏推荐
- 1293_ Implementation analysis of xtask resumeall() interface in FreeRTOS
- 【转载】解决conda安装pytorch过慢的问题
- Smart regulation enters the market, where will meituan and other Internet service platforms go
- Solution to the problem of unserialize3 in the advanced web area of the attack and defense world
- Service Mesh介绍,Istio概述
- [programming questions] [scratch Level 2] March 2019 garbage classification
- Su embedded training - day4
- How to add automatic sorting titles in typora software?
- Jouer sonar
- ABAP ALV LVC template
猜你喜欢

取消select的默认样式的向下箭头和设置select默认字样

《因果性Causality》教程,哥本哈根大学Jonas Peters讲授

DNS series (I): why does the updated DNS record not take effect?

"An excellent programmer is worth five ordinary programmers", and the gap lies in these seven key points
![[OBS] the official configuration is use_ GPU_ Priority effect is true](/img/df/772028e44776bd667e814989e8b09c.png)
[OBS] the official configuration is use_ GPU_ Priority effect is true

Lecture 1: the entry node of the link in the linked list

RPA cloud computer, let RPA out of the box with unlimited computing power?

从服务器到云托管,到底经历了什么?

new和delete的底层原理以及模板

How to learn a new technology (programming language)
随机推荐
redis你到底懂不懂之list
Leetcode brush questions
C language 005: common examples
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
An error is reported during the process of setting up ADG. Rman-03009 ora-03113
tourist的NTT模板
How to insert highlighted code blocks in WPS and word
快速上手使用本地测试工具postman
Handwriting a simulated reentrantlock
Two small problems in creating user registration interface
华为交换机S5735S-L24T4S-QA2无法telnet远程访问
52岁的周鸿祎,还年轻吗?
Tapdata 的 2.0 版 ,开源的 Live Data Platform 现已发布
Solution to the problem of unserialize3 in the advanced web area of the attack and defense world
Coindesk comments on the decentralization process of the wave field: let people see the future of the Internet
If an exception is thrown in the constructor, the best way is to prevent memory leakage?
Jouer sonar
Course of causality, taught by Jonas Peters, University of Copenhagen
他们齐聚 2022 ECUG Con,只为「中国技术力量」
某马旅游网站开发(对servlet的优化)