3 条题解
-
0
#include<bits/stdc++.h> using namespace std; int main() { cout << "0" << " " << "20" << " " << "10" << endl; cout << "1" << " " << "18" << " " << "11" << endl; cout << "2" << " " << "16" << " " << "12" << endl; cout << "3" << " " << "14" << " " << "13" << endl; cout << "4" << " " << "12" << " " << "14" << endl; cout << "5" << " " << "10" << " " << "15" << endl; cout << "6" << " " << "8" << " " << "16" << endl; cout << "7" << " " << "6" << " " << "17" << endl; cout << "8" << " " << "4" << " " << "18" << endl; cout << "9" << " " << "2" << " " << "19" << endl; cout << "10" << " " << "0" << " " << "20" << endl; return 0; }//A
-
0
#include<bits/stdc++.h> using namespace std; int main() { int i,j,x,y; //循环男人可能的人数 for(i = 0; i <= 50 / 3; i++){ //剩余的钱 x = 50 - i * 3; //循环女人可能的人数 for(j = 0; j <= x / 2; j++){ y = x - j * 2; //剩余的y元,分配给小孩,要求总人数为30 if(i+j+y == 30){ cout << i << " " << j << " " << y << endl; } } } return 0; }
- 1
信息
- ID
- 250
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 2
- 标签
- 递交数
- 76
- 已通过
- 46
- 上传者