当前位置:网站首页>1061 True or False (15 points)
1061 True or False (15 points)
2022-08-11 07:48:00 【dumb bit】
题目要求:
代码:
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]);
}
}
}
结果:
边栏推荐
猜你喜欢
公牛10-11德里克·罗斯最强赛季记录
3.1-分类-概率生成模型
伦敦银规则有哪些?
Redis source code: how to view the Redis source code, the order of viewing the Redis source code, the sequence of the source code from the external data structure of Redis to the internal data structu
详述 MIMIC护理人员信息表(十五)
1091 N-Defensive Number (15 points)
关于Excel实现分组求和最全文档
linux 安装mysql服务报错
Pico neo3在Unity中的交互操作
Amazon API interface Daquan
随机推荐
技术分享 | 实战演练接口自动化如何处理 Form 请求?
项目2-年收入判断
How Unity handles C# under the hood
Activity的四种状态
Trill keyword search goods - API
【软件测试】(北京)字节跳动科技有限公司二面笔试题
go-grpc TSL认证 解决 transport: authentication handshake failed: x509 certificate relies on ... ...
Douyin API interface
How Unity programmers can improve their abilities
2022-08-10 Group 4 Self-cultivation class study notes (every day)
TF中的条件语句;where()
How do you optimize the performance of your Unity project?
PIXHAWK飞控使用RTK
2022-08-09 Group 4 Self-cultivation class study notes (every day)
2022-08-09 第四小组 修身课 学习笔记(every day)
从苹果、SpaceX等高科技企业的产品发布会看企业产品战略和敏捷开发的关系
易观分析联合中小银行联盟发布海南数字经济指数,敬请期待!
博途PLC 1200/1500PLC ModbusTcp通信梯形图优化汇总(多服务器多从站轮询)
Serverless + domain name can also build a personal blog? Really, and soon
动态代理学习