当前位置:网站首页>牛客基础语法必刷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]);
}
}
边栏推荐
- Hotel
- Prompt configure: error: required tool not found: libtool solution when configuring and installing crosstool ng tool
- 浪潮云溪分布式数据库 Tracing(二)—— 源码解析
- 5g NR system messages
- Binder核心API
- Basic principle and usage of dynamic library, -fpic option context
- The difference between -s and -d when downloading packages using NPM
- 22年秋招心得
- Langchao Yunxi distributed database tracing (II) -- source code analysis
- Summary of weidongshan phase II course content
猜你喜欢

从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值

Is Zhou Hongyi, 52, still young?

去了字节跳动,才知道年薪 40w 的测试工程师有这么多?

C# 泛型及性能比较

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

Tencent security released the white paper on BOT Management | interpreting BOT attacks and exploring ways to protect

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

Single machine high concurrency model design

52歲的周鴻禕,還年輕嗎?

Play sonar
随机推荐
应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
SDNU_ACM_ICPC_2022_Summer_Practice(1~2)
3 years of experience, can't you get 20K for the interview and test post? Such a hole?
5g NR system messages
Where is the big data open source project, one-stop fully automated full life cycle operation and maintenance steward Chengying (background)?
Summary of weidongshan phase II course content
第一讲:链表中环的入口结点
RPA cloud computer, let RPA out of the box with unlimited computing power?
If an exception is thrown in the constructor, the best way is to prevent memory leakage?
玩轉Sonar
[Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output
C# 泛型及性能比较
How does the markdown editor of CSDN input mathematical formulas--- Latex syntax summary
《因果性Causality》教程,哥本哈根大学Jonas Peters讲授
C # generics and performance comparison
从Starfish OS持续对SFO的通缩消耗,长远看SFO的价值
爬虫实战(八):爬表情包
Installation and configuration of sublime Text3
Reptile practice (VIII): reptile expression pack
Which securities company has a low, safe and reliable account opening commission