(総合演習 III)
http://www.sw.it.aoyama.ac.jp/2017/CP1/lecture14.html
© 2005-17 Martin J. Dürst 青山学院大学
| 1301 | 1302 | 1303 | 1304 | |
| 100 points | 68 | 39 | 1 | 9 |
| 60 points | 24 | 51 | 44 | 42 |
| errors | 1 | 1 | 6 | - |
| not submitted | 6 | 8 | 48 | 48 |
Total of problems solved: 4 problems: 32 students, 3 problems: 16 students, 2 problems: 45 students, 1 problems: 2 students, 0 problems: 1 student
Number of students who did not complete a single problem before 18:30: 22 students
a, b, c,...)Using functions:
int shrimp(int protein,int calcium)
{
int price;
price = protein+calcium;
if (price>=20) return price-20;
else return 0;
}
Using initialization:
#define FOODS 8
#define NUTRIENTS 5
typedef struct { int nutrient[NUTRIENTS]; int price; } Food;
int main(void)
{
Food foods[FOODS] = { { { 1, 1, 0, 0, 0}, 22 },
{ { 0, 1, 1, 0, 0}, 20 },
...
};
...
}
Data across multiple trials: none
Data common to all investment plans: duration, interest rate ⇒ single variables
Number of investment plans: Maximum 20 ⇒ array
Data per investment plan: initial investment, sales profit, operating
expenses, net revenue, net present value, plan number ⇒
struct
今日出される問題の内、最低一問を時間内に提出、できない場合は必ず居残り、宿題を含め最低二問を完成することを強く推薦
締切は全部 7月19日 (水曜日); 質問の締切は 7月19日の14:00
解く順番は自由が、解き始めた問題は完成 (1401 からの順で推薦)
入力は問題文で説明した範囲内に限定 (エラーチェックは不要)
解け方 (アルゴリズム) は (紙などで) 例を作って実験してみる
Q&A フォーラムの活用! 題名に注意!
(問題文の詳細や解き方についての質問も勿論可能)