Skip to content
返回

0x000a 【深基1.习4】简单的分苹果 3

编辑页面

题目描述

给同学分苹果,若每人分 33 个就剩下 1111 个;如果每人分 44 个则少一个,请问有多少同学,有多少个苹果?

输入格式

不需要输入。

输出格式

请输出两个整数表示答案,使用空格隔开。

题目分析

目的:求出有多少同学,有多少个苹果。

设学生人数为 x,苹果数量为 y,则:

{3x+11=y4x1=y\begin{cases} 3x+11=y\\ 4x-1=y\\ \end{cases}

则,可推出:

{x=12y=47\begin{cases} x=12\\ y=47\\ \end{cases}

代码实现

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
const int N = 1e5 + 5;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << 12 << " " << 47;
  return 0;
}

编辑页面
分享这篇文章至:

上一篇
0x0009 【深基1.习3】竞赛得分
下一篇
0x0008 【深基1.习2】面积计算