My student number: s114099 x = 0.15 f(x) = 1.01125 ----------------------------------- |
/* ************************************************** */ /* */ /* 情報科学演習 C6 C7 */ /* レポート課題 */ /* 2011.10.31 */ /* */ /* ************************************************** */ /* */ /* 学生番号: */ /* */ /* 氏名: */ /* */ /* ************************************************** */ /* */ /* この行以降に解答のプログラムを書くこと */ #include <stdio.h> #include <stdlib.h> #include <time.h> main() { srand((unsigned) time(NULL)); float x, f; x = (rand() % 3) / 20.0 + 0.05; f = 1 + x * x / 2; printf("My student number: s114099\n\n"); printf("x = %4.2f f(x) = %7.5f\n\n", x, f); printf("------------------------------\n\n"); return(0); } |