当前位置:网站首页>1061 判断题 (15 分)
1061 判断题 (15 分)
2022-08-11 06:46:00 【呆比特】
题目要求:
代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
//輸入
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int m = scanner.nextInt();
scanner.nextLine();
String []fenShu = scanner.nextLine().split(" ");
String []daAn = scanner.nextLine().split(" ");
int []deFen = new int[n];
for (int i = 0; i <n; i++) {
String[] s = scanner.nextLine().split(" ");
int sum = 0;
for (int j = 0; j < m; j++) {
if (Integer.valueOf(s[j]) == Integer.valueOf(daAn[j]))
sum += Integer.valueOf(fenShu[j]);
}
deFen[i] = sum;
}
for (int i = 0; i < n; i++) {
System.out.println(deFen[i]);
}
}
}
结果:
边栏推荐
- Discourse 的关闭主题(Close Topic )和重新开放主题
- Find the shops that have sold more than 1,000 yuan per day for more than 30 consecutive days in the past six months
- jar服务导致cpu飙升问题-带解决方法
- How do you optimize the performance of your Unity project?
- 【软件测试】(北京)字节跳动科技有限公司终面HR面试题
- Service的两种启动方式与区别
- 2022-08-09 第四小组 修身课 学习笔记(every day)
- What are the things that should be planned from the beginning when developing a project with Unity?How to avoid a huge pit in the later stage?
- MySQL使用GROUP BY 分组查询时,SELECT 查询字段包含非分组字段
- cdc连sqlserver异常对象可能有无法序列化的字段 有没有大佬看得懂的 帮忙解答一下
猜你喜欢
伦敦银规则有哪些?
Resolved EROR 1064 (42000): You have an error in. your SOL syntax. check the manual that corresponds to yo
tf中自减操作;tf.assign_sub()
基于FPGA的FIR滤波器的实现(4)— 串行结构FIR滤波器的FPGA代码实现
prometheus学习5altermanager
囍楽云任务源码
opencv实现数据增强(图片+标签)平移,翻转,缩放,旋转
unable to extend table xxx by 1024 in tablespace xxxx
linux 安装mysql服务报错
从何跟踪伦敦金最新行情走势?
随机推荐
Coordinate system in navigation and positioning
线程交替输出(你能想出几种方法)
Implement general-purpose, high-performance sorting and quicksort optimizations
How Unity programmers can improve their abilities
2021-08-11 for循环结合多线程异步查询并收集结果
接入网、承载网、核心网是什么,交换机路由器是什么、这个和网络的协议有什么关系呢?
Waldom Electronics宣布成立顾问委员会
NFT 的价值从何而来
【Pytorch】nn.ReLU(inplace=True)
Amazon API interface Daquan
进制转换间的那点事
Tf中的平方,多次方,开方计算
Get Pinduoduo product information operation details
【LeetCode每日一题】——682.棒球比赛
公牛10-11德里克·罗斯最强赛季记录
DDR4内存条电路设计
【sdx62】XBL设置共享内存变量,然后内核层获取变量实现
pytorch,numpy两种方法实现nms类间+类内
一张图了解JVM八大原子操作
buu—Re(5)