当前位置:网站首页>牛客基础语法必刷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]);
}
}
边栏推荐
- Linkedblockingqueue source code analysis - add and delete
- NVIDIA Jetson测试安装yolox过程记录
- Play sonar
- 赞!idea 如何单窗口打开多个项目?
- 商品的设计等整个生命周期,都可以将其纳入到产业互联网的范畴内
- 【obs】Impossible to find entrance point CreateDirect3D11DeviceFromDXGIDevice
- Notice on organizing the second round of the Southwest Division (Sichuan) of the 2021-2022 National Youth electronic information intelligent innovation competition
- [programming problem] [scratch Level 2] 2019.09 make bat Challenge Game
- 单机高并发模型设计
- Is 35 really a career crisis? No, my skills are accumulating, and the more I eat, the better
猜你喜欢

“一个优秀程序员可抵五个普通程序员”,差距就在这7个关键点

STM32F1與STM32CubeIDE編程實例-旋轉編碼器驅動

Smart regulation enters the market, where will meituan and other Internet service platforms go

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

Application practice | the efficiency of the data warehouse system has been comprehensively improved! Data warehouse construction based on Apache Doris in Tongcheng digital Department

redis你到底懂不懂之list

Thinkphp内核工单系统源码商业开源版 多用户+多客服+短信+邮件通知

Relevant methods of sorting arrays in JS (if you want to understand arrays, it's enough to read this article)

他们齐聚 2022 ECUG Con,只为「中国技术力量」

new和delete的底层原理以及模板
随机推荐
An error is reported during the process of setting up ADG. Rman-03009 ora-03113
RPA cloud computer, let RPA out of the box with unlimited computing power?
new和delete的底层原理以及模板
What is load balancing? How does DNS achieve load balancing?
What if the testing process is not perfect and the development is not active?
They gathered at the 2022 ecug con just for "China's technological power"
What has happened from server to cloud hosting?
【obs】Impossible to find entrance point CreateDirect3D11DeviceFromDXGIDevice
【obs】官方是配置USE_GPU_PRIORITY 效果为TRUE的
Binder核心API
QT establish signal slots between different classes and transfer parameters
QT adds resource files, adds icons for qaction, establishes signal slot functions, and implements
Sqlite数据库存储目录结构邻接表的实现2-目录树的构建
ABAP ALV LVC template
Qt添加资源文件,为QAction添加图标,建立信号槽函数并实现
Solution to prompt configure: error: curses library not found when configuring and installing crosstool ng tool
去了字节跳动,才知道年薪 40w 的测试工程师有这么多?
Which securities company has a low, safe and reliable account opening commission
Flask learning record 000: error summary
After going to ByteDance, I learned that there are so many test engineers with an annual salary of 40W?