当前位置:网站首页>牛客基础语法必刷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]);
}
}
边栏推荐
- Trust orbtk development issues 2022
- Service Mesh的基本模式
- 接口测试要测试什么?
- Su embedded training - day4
- [OBS] the official configuration is use_ GPU_ Priority effect is true
- LeetCode刷题
- [programming questions] [scratch Level 2] March 2019 garbage classification
- QT adds resource files, adds icons for qaction, establishes signal slot functions, and implements
- paddle入门-使用LeNet在MNIST实现图像分类方法一
- Installation and configuration of sublime Text3
猜你喜欢

SDNU_ACM_ICPC_2022_Summer_Practice(1~2)

RPA云电脑,让RPA开箱即用算力无限?

Two small problems in creating user registration interface

"An excellent programmer is worth five ordinary programmers", and the gap lies in these seven key points

玩转Sonar

51 communicates with the Bluetooth module, and 51 drives the Bluetooth app to light up

赞!idea 如何单窗口打开多个项目?

大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?

语义分割模型库segmentation_models_pytorch的详细使用介绍

DNS series (I): why does the updated DNS record not take effect?
随机推荐
new和delete的底层原理以及模板
The difference between get and post
RPA cloud computer, let RPA out of the box with unlimited computing power?
攻防世界Web进阶区unserialize3题解
测试流程不完善,又遇到不积极的开发怎么办?
德总理称乌不会获得“北约式”安全保障
Cause analysis and solution of too laggy page of [test interview questions]
什么是负载均衡?DNS如何实现负载均衡?
51与蓝牙模块通讯,51驱动蓝牙APP点灯
Reentrantlock fair lock source code Chapter 0
服务器防御DDOS的方法,杭州高防IP段103.219.39.x
[programming problem] [scratch Level 2] draw ten squares in December 2019
Zhou Hongqi, 52 ans, est - il encore jeune?
大数据开源项目,一站式全自动化全生命周期运维管家ChengYing(承影)走向何方?
去了字节跳动,才知道年薪 40w 的测试工程师有这么多?
If an exception is thrown in the constructor, the best way is to prevent memory leakage?
C # generics and performance comparison
What if the testing process is not perfect and the development is not active?
8道经典C语言指针笔试题解析
《因果性Causality》教程,哥本哈根大学Jonas Peters讲授