当前位置:网站首页>牛客基础语法必刷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]);
}
}
边栏推荐
- DNS 系列(一):为什么更新了 DNS 记录不生效?
- 3 years of experience, can't you get 20K for the interview and test post? Such a hole?
- 哪个券商公司开户佣金低又安全,又靠谱
- QT adds resource files, adds icons for qaction, establishes signal slot functions, and implements
- 华泰证券官方网站开户安全吗?
- What has happened from server to cloud hosting?
- 52歲的周鴻禕,還年輕嗎?
- DNS series (I): why does the updated DNS record not take effect?
- 52岁的周鸿祎,还年轻吗?
- fabulous! How does idea open multiple projects in a single window?
猜你喜欢

5G NR 系统消息

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

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

Huawei switch s5735s-l24t4s-qa2 cannot be remotely accessed by telnet

The underlying principles and templates of new and delete
![[Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output](/img/79/f5cffe62d5d1e4a69b6143aef561d9.png)
[Yugong series] go teaching course 006 in July 2022 - automatic derivation of types and input and output

Notice on organizing the second round of the Southwest Division (Sichuan) of the 2021-2022 National Youth electronic information intelligent innovation competition

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

paddle一个由三个卷积层组成的网络完成cifar10数据集的图像分类任务

第一讲:链表中环的入口结点
随机推荐
韦东山第三期课程内容概要
浪潮云溪分布式数据库 Tracing(二)—— 源码解析
SDNU_ACM_ICPC_2022_Summer_Practice(1~2)
Emotional post station 010: things that contemporary college students should understand
Codeforces Round #804 (Div. 2)(A~D)
C language 005: common examples
Zhou Hongqi, 52 ans, est - il encore jeune?
STM32F1與STM32CubeIDE編程實例-旋轉編碼器驅動
爬虫实战(八):爬表情包
应用实践 | 数仓体系效率全面提升!同程数科基于 Apache Doris 的数据仓库建设
The underlying principles and templates of new and delete
5g NR system messages
【笔记】常见组合滤波电路
Kubernetes Static Pod (静态Pod)
玩轉Sonar
51与蓝牙模块通讯,51驱动蓝牙APP点灯
Thinkphp内核工单系统源码商业开源版 多用户+多客服+短信+邮件通知
Su embedded training - day4
华泰证券官方网站开户安全吗?
ReentrantLock 公平锁源码 第0篇