My student number: s186099 Dice: 1 ------------------------ |
なお,結果の出力では必ず最初の行に自分の学生番号を,最後にハイフンによるラインをつけること.無い場合には減点するので注意.
// ************************************************** // // レポート課題 // 2018.12.03 // // ************************************************** // // 学生番号: // // 氏名: // // ************************************************** // // #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { srand((unsigned) time(NULL)); printf("My student number: s186099\n\n"); int dice = rand() % 10 + 1; if(dice<=6) { printf("Dice: %d\n", dice); } else { printf("Dice: 1\n"); } printf("\n------------------------\n\n"); return 0; } |