Witam
Losuje liczby od 1 do 100 bez powtórzeń
#include <cstdlib>#include <iostream>#include <string>#include <time.h>using namespace std;int i, ii, i3, i4;int l=0;int r=0;int tab[99];int main(int argc, char *argv[]){ srand((unsigned)time(0)); tab[0] = (rand()%100)+1; for(i3=1;i3<100;i3++){ tab[i3] = 0;}// cout<<" i przed for = "<<i<<endl;// cout<<" l przed for = "<<l<<endl; for(i=1;i<100;i++){///1 tab[i] = (rand()%100)+1; l=0;// cout<<" i w for = "<<i<<endl;// cout<<" l w for = "<<l<<endl; while(l<i){// cout<<" i w while = "<<i<<endl;// cout<<" l w while = "<<l<<endl; i4=i; if(tab[l]==tab[i4]){// cout<<" i w if = "<<i<<endl;// cout<<" l w if = "<<l<<endl; i--;} l++;} }///1 cout<<"wynik = "; while(r<100){ cout<<" "<<tab[r]; r++;} cout<<endl;}/// main