当前位置:网站首页>牛客基础语法必刷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]);
}
}
边栏推荐
- 【测试面试题】页面很卡的原因分析及解决方案
- Service Mesh介绍,Istio概述
- Leetcode brush questions
- 智慧监管入场,美团等互联网服务平台何去何从
- RPA cloud computer, let RPA out of the box with unlimited computing power?
- 韦东山第二期课程内容概要
- What has happened from server to cloud hosting?
- 浪潮云溪分布式数据库 Tracing(二)—— 源码解析
- 德总理称乌不会获得“北约式”安全保障
- Huawei switch s5735s-l24t4s-qa2 cannot be remotely accessed by telnet
猜你喜欢
C# 泛型及性能比较
"An excellent programmer is worth five ordinary programmers", and the gap lies in these seven key points
Is 35 really a career crisis? No, my skills are accumulating, and the more I eat, the better
某马旅游网站开发(对servlet的优化)
An error is reported during the process of setting up ADG. Rman-03009 ora-03113
单机高并发模型设计
某马旅游网站开发(登录注册退出功能的实现)
C language 005: common examples
[programming problem] [scratch Level 2] draw ten squares in December 2019
接口测试要测试什么?
随机推荐
赞!idea 如何单窗口打开多个项目?
SDNU_ACM_ICPC_2022_Summer_Practice(1~2)
An error is reported during the process of setting up ADG. Rman-03009 ora-03113
韦东山第二期课程内容概要
They gathered at the 2022 ecug con just for "China's technological power"
他们齐聚 2022 ECUG Con,只为「中国技术力量」
Hotel
Zhou Hongqi, 52 ans, est - il encore jeune?
QT adds resource files, adds icons for qaction, establishes signal slot functions, and implements
动态库基本原理和使用方法,-fPIC 选项的来龙去脉
[basis of recommendation system] sampling and construction of positive and negative samples
应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
Kubernetes Static Pod (静态Pod)
Summary of weidongshan phase II course content
How to insert highlighted code blocks in WPS and word
“一个优秀程序员可抵五个普通程序员”,差距就在这7个关键点
快速上手使用本地测试工具postman
C language 005: common examples
3 years of experience, can't you get 20K for the interview and test post? Such a hole?
语义分割模型库segmentation_models_pytorch的详细使用介绍