C言語プログラミング実習課題集

課題1: ランダムな学籍番号生成 #include <stdio.h> #include <stdlib.h> #include <time.h> #define NUM_ITEMS 5 int main() { int rand_val; srand(time(0)); for (int count = 0; count < NUM_ITEMS; count++) { rand_val = rand() % 100 + 1; printf("20240042%04d\n", rand_val); } return 0; } この ...

7月6日 23:04 投稿