2010-10-14 AOJ - Problem 0014 : Integral AOJ 問題文 積分の問題なのでdouble型を使うと思いきや整数値しか使わない問題でした。 長方形の面積の和を出力します。 #include <iostream> using namespace std; int f(int x){ return (x*x); } int main(){ int d,s; while( cin >> d ){ s = 0; for(int i=1 ; (d*i)<=(600-d) ; i++){ s += f(d*i)*d; } cout << s << endl; } }