Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by Kris ( 14 years ago )
#include <cstdlib>
#include <iostream>
#include <ctime>

using namespace std;
int wypelnianie(int tab[])
{
 srand(time(0));
 for(int i=0;i<=998;i++)
 {
  ((rand()%7)+4);
  tab[i]=((rand()%7)+4);
  
  
  }
 
}
int wypisz(int tab[])
{
  for(int i=0;i<=998;i++)
 {
  
  cout<<tab[i]<<"  ";
  
  
  }
  cout<<endl;
 
}
int suma(int tab[])
{
 int suma=0;
 for(int i=0;i<=998;i++)
 {
  
 suma=suma+tab[i];
 i=i+1;
 }
 cout<<"Suma rowna sie: "<<suma<<endl;
 
}
int main(int argc, char *argv[])
{
 int tab[999];
 wypelnianie(tab);
 wypisz(tab);
 suma(tab);
 
 system&#40;"pause"&#41;;
 return 0;
}

 

Revise this Paste

Your Name: Code Language: