Есть ответ 👍

С++ как задать массив случайным образом int a[16]

156
317
Посмотреть ответы 2

Ответы на вопрос:


#include < iostream.h> //для vs < iostream> #include < conio.h> /* для vs : using std: : cin; using std: : cout; using std: : endl; using std: : srand; using std: : rand; */int main(){   int a[16],i,n; randomize(); //< -> srand;   cout< < "exit-0\n"; while(n! =0 ){m: cout< < "vvedite razmer massiva (n< =16) : \n"; cin> > n; if(n> 16) cout< < "error! n> 16 . try again\n"; if(n> 16) goto m; for (i=0; i< n; i++)a[i]=random(100); //< -> rand(); cout< < endl; for (i=0; i< n; i++)cout< < a[i]< < " "; cout< < endl; }getch();   return 0; }

ответ:

3. d: \весна\ландыш.doc

Популярно: Информатика