過去ログ
No.1022 ループの継続条件にrand()を使うと
訂正。すいません。 #include <stdio.h> #include <stdlib.h> int main(void){ char ch = '*'; int x, y; x = 0; while(x < 10){ for(y = 0; y < rand() % 80 + 1; y++){ printf("%c", ch); } putchar('\n'); x++; } return 0; }
for(y = 0; y < rand() % 80 + 1; y++)