1 solutions
-
1
题目描述
给同学分苹果,若每人分 33 个就剩下 1111 个;如果每人分 44 个则少一个,请问有多少同学,有多少个苹果?
题目解析
本题可以运用解方程
解:设有x个小朋友.
x*3+11=4x-1
3x+11=4x-1
3x+12=4x
x=12
4 * 12-1=47或者3*12+11=47
参考程序
#include<bits/stdc++.h> using namespace std; int main() { int x=0; for(int i=0;i<50;i++,x++) { if(x*3+11==x*4-1) { cout<<x<<" "; break; } } cout<<x*3+11; return 0; }
- 1
Information
- ID
- 585
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 4
- Tags
- (None)
- # Submissions
- 29
- Accepted
- 16
- Uploaded By