---
title: "宴席共有多少人"
author: "bill.end"
date: "2010-12-08T12:54:28Z"
tags: []
categories: ["编程语言"]
slug: "untitled"
draft: false
lastmod: "2010-12-08T12:55:12Z"
id: 836569
url: "https://bill-end.iteye.com/blog/836569"
---

一次酒店宴席安排宾客就座吃饭，5人一桌剩4人，7人一桌剩6人，9人一桌剩8人，11人一桌正好。问宴席共有多少人？ 

根据要求：
5A+4=11X
7B+6=11X
9C+8=11X

把3个方程都加1：
5A=11X+1
7B=11X+1
9C=11X+1

所以：
5×7×9×K=11X+1
315K=11X+1


```java

int i = 1;
while ((315*i-1)%11!=0) {
   i++;
}
System.out.println(315*i-1)
```

i=8
结果2519