当前位置:网站首页>牛客基础语法必刷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]);
}
}
边栏推荐
- [programming questions] [scratch Level 2] March 2019 garbage classification
- 【GO记录】从零开始GO语言——用GO语言做一个示波器(一)GO语言基础
- fabulous! How does idea open multiple projects in a single window?
- Thinkphp内核工单系统源码商业开源版 多用户+多客服+短信+邮件通知
- The method of server defense against DDoS, Hangzhou advanced anti DDoS IP section 103.219.39 x
- Codeforces Round #804 (Div. 2)(A~D)
- QT establish signal slots between different classes and transfer parameters
- 韦东山第二期课程内容概要
- 接口测试进阶接口脚本使用—apipost(预/后执行脚本)
- How to add automatic sorting titles in typora software?
猜你喜欢

The underlying principles and templates of new and delete

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

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

Langchao Yunxi distributed database tracing (II) -- source code analysis

Play sonar

51与蓝牙模块通讯,51驱动蓝牙APP点灯
![[programming questions] [scratch Level 2] March 2019 garbage classification](/img/08/9f7ebf4302c9239784751b579c9efc.png)
[programming questions] [scratch Level 2] March 2019 garbage classification

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

DNS 系列(一):为什么更新了 DNS 记录不生效?
![[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
随机推荐
Hotel
Codeforces Round #804 (Div. 2)(A~D)
《因果性Causality》教程,哥本哈根大学Jonas Peters讲授
Four stages of sand table deduction in attack and defense drill
接口测试进阶接口脚本使用—apipost(预/后执行脚本)
Common selectors are
Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades(KDD20)
5g NR system messages
Jouer sonar
tourist的NTT模板
ABAP ALV LVC模板
爬虫实战(八):爬表情包
Coindesk comments on the decentralization process of the wave field: let people see the future of the Internet
Notice on organizing the second round of the Southwest Division (Sichuan) of the 2021-2022 National Youth electronic information intelligent innovation competition
ReentrantLock 公平锁源码 第0篇
Qt不同类之间建立信号槽,并传递参数
Reading notes 004: Wang Yangming's quotations
paddle一个由三个卷积层组成的网络完成cifar10数据集的图像分类任务
[programming problem] [scratch Level 2] draw ten squares in December 2019
Leetcode brush questions