当前位置:网站首页>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]);
}
}
}
结果:
边栏推荐
- 软件测试基本流程有哪些?北京专业第三方软件检测机构安利
- 6月各手机银行活跃用户较快增长,创半年新高
- Daily sql - judgment + aggregation
- 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 版本升级心得
- Daily sql: request for friend application pass rate
- Redis源码:Redis源码怎么查看、Redis源码查看顺序、Redis外部数据结构到Redis内部数据结构查看源码顺序
- Waldom Electronics宣布成立顾问委员会
- When MySQL uses GROUP BY to group the query, the SELECT query field contains non-grouping fields
- Taobao product details API interface
猜你喜欢
【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
伦敦银规则有哪些?
一张图了解JVM八大原子操作
Multiscale communication in cortical-cortical networks
【latex异常和错误】Missing $ inserted.<inserted text>You can‘t use \spacefactor in math mode.输出文本要注意特殊字符的转义
prometheus学习5altermanager
Taobao API common interface and acquisition method
Get Pinduoduo product information operation details
Discourse 的关闭主题(Close Topic )和重新开放主题
JD.com product details API call example explanation
随机推荐
Attitude solution - gyroscope + Euler method
Find the shops that have sold more than 1,000 yuan per day for more than 30 consecutive days in the past six months
3GPP LTE/NR信道模型
CIKM 2022 AnalytiCup Competition: 联邦异质任务学习
Taobao product details API interface
PIXHAWK飞控使用RTK
一张图了解JVM八大原子操作
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?
Pytorch模型转ONNX模型
Pinduoduo API interface (attach my available API)
Discourse's Close Topic and Reopen Topic
囍楽云任务源码
Internet phone software or consolidation of attack must be "free" calls security clearance
李沐d2l(十)--卷积层Ⅰ
下一代 无线局域网--强健性
MindManager2022全新正式免费思维导图更新
【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
DDR4内存条电路设计
js根据当天获取前几天的日期
为什么我使用C#操作MySQL进行中文查询失败