当前位置:网站首页>1106 2019 Sequence (15 points)
1106 2019 Sequence (15 points)
2022-08-11 07:48:00 【dumb bit】
题目要求:
代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
String [] array = new String[1000];
array[0] = "2";
array[1] = "0";
array[2] = "1";
array[3] = "9";
//加数
for (int i = 0; i < n-4; i++) {
int sum = Integer.valueOf(array[i]) + Integer.valueOf(array[i+1]) + Integer.valueOf(array[i+2]) + Integer.valueOf(array[i+3]);
String right = sum % 10 + "";
array[i + 4] = right;
}
//Convert valid bits to array、
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < n; i++) {
stringBuilder.append(array[i]);
}
System.out.println(stringBuilder);
}
}
结果:
边栏推荐
猜你喜欢
TF中使用softmax函数;
1096 大美数 (15 分)
Discourse's Close Topic and Reopen Topic
【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
技术分享 | 实战演练接口自动化如何处理 Form 请求?
tf.cast(), reduce_min(), reduce_max()
【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义
1081 检查密码 (15 分)
公牛10-11德里克·罗斯最强赛季记录
基于FPGA的FIR滤波器的实现(5)— 并行结构FIR滤波器的FPGA代码实现
随机推荐
Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
unable to extend table xxx by 1024 in tablespace xxxx
基于FPGA的FIR滤波器的实现(5)— 并行结构FIR滤波器的FPGA代码实现
1046 划拳 (15 分)
cdc连sqlserver异常对象可能有无法序列化的字段 有没有大佬看得懂的 帮忙解答一下
关于Excel实现分组求和最全文档
When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
2022-08-10 第四小组 修身课 学习笔记(every day)
【Pytorch】nn.ReLU(inplace=True)
Service的两种状态形式
golang fork 进程的三种方式
1071 小赌怡情 (15 分)
详述MIMIC 的ICU患者检测时间信息表(十六)
2022-08-09 第四小组 修身课 学习笔记(every day)
【@网络工程师:用好这6款工具,让你的工作效率大翻倍!】
恒源云-Pycharm远程训练避坑指南
pytorch,numpy两种方法实现nms类间+类内
Edge provides label grouping functionality
1101 B是A的多少倍 (15 分)
jar服务导致cpu飙升问题-带解决方法