Nje zgjidhje per Windows: (ne unix/linux duhet ndryshuar Sleep me sleep dhe ndryshuar windows.h me librarine perkatese ku ndoshet sleep() )
Kodi:
#include
using namespace std;
#include
#define GJATESIA 7
int main ()
{
// deklaro ndryshoret
int varg[GJATESIA],
pauza = 100, // millisekonda
here = 10,
indeks;
// inicio vargun
for(varg[0]=2, indeks = 1; indeks < GJATESIA; indeks++)
varg[indeks] = 2 * varg[indeks-1];
while(here--)
{
int *treguesVargu = varg,
*fundVargu = varg + GJATESIA;
while( treguesVargu != fundVargu )
{
cout << *treguesVargu++ << " ";
Sleep(pauza);
}
cout << endl;
}
}
Krijoni Kontakt