CCF 202012-1 期末预测之安全指数 (水题)
作者:互联网
思路:啊这,可不就是水题嘛,不过java菜狗连输入输出都要搜索┭┮﹏┭┮。
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt();
int ans = 0, x, y;
for(int i = 0; i < n; i ++){
x = input.nextInt();
y = input.nextInt();
ans += x*y;
}
System.out.println(Math.max(ans, 0));
}
}
标签:Scanner,水题,int,202012,nextInt,ans,input,CCF 来源: https://blog.csdn.net/Satur9/article/details/114955526