0
点赞
收藏
分享

微信扫一扫

P1161 开灯

上善若水的道 2022-01-27 阅读 78

在这里插入图片描述

package 入门4;
import java.util.Scanner;
public class P1161开灯 {
	public static void main(String []args) {
		Scanner in = new Scanner(System.in);
		int a = in.nextInt(),m = 0;
		
		for(int i = 0; i<a; i++) {	
			double b = in.nextDouble();
			int c = in.nextInt();
			for(int j = 1; j<= c; j++) {
				int x = (int)Math.floor(j*b);
				m^=x;
			}
		}
		System.out.println(m);
	}
}

举报

相关推荐

0 条评论