2012-01-07から1日間の記事一覧

AOJ 0160 - Delivery Fee

aoj

そのまま実装すればいい. #include <iostream> int whatPrice(int, int); int main(){ int n; while(std::cin >> n, n){ int price = 0; while(n--){ int x, y, h, w; std::cin >> x >> y >> h >> w; price += whatPrice(x+y+h, w); } std::cout << price << std::end</iostream>…

AOJ 0159 - The Best Body

aoj

BMIから標準BMI22を引いた絶対値が標準との差,それを使うだけの問題. #include <iostream> #include <cstdio> #include <math.h> const int INF = 1000000, SBMI = 22; int main(){ int n; while(std::cin >> n, n){ double bbmi = INF; int bn = 0; while(n--){ //Input int i; doub</math.h></cstdio></iostream>…