SGU 184: Patties

Jasonlin posted @ 2011年3月31日 15:26 in SGU with tags 常识 , 3022 阅读

题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=184

题目大意:

      一个人喜欢办Party,家里有3种东西,知道要举办一个party每种东西需要的量,问家里的东西能过举办几场party.

解题思路:

      分别求出每种东西能办几场,最小的值就是答案。

解题代码:

#include<iostream>
using namespace std;
int main(){
	int p,m,c,k,r,v;
	while(cin>>p>>m>>c>>k>>r>>v){
		int a=p/k,b=m/r,d=c/v;
		int n=a;
		if(n>b) n=b;
		if(n>d) n=d;
		cout<<n<<endl;
	}
	return 0;
}

扩展知识:http://en.wikipedia.org/wiki/Vegetable

  • 无匹配
  • 无匹配
kevin 说:
2022年1月21日 20:38

This is really nice to read. informative post is very good to read thanks for sharing. | <a href="https://bigfishmarketing.com/write/">copywriting services</a>|
<a href="https://bigfishmarketing.com/write/">speechwriters</a> |
<a href="https://bigfishmarketing.com/write/">speech writing</a> |


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter