Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- long double x, silnia;
- cout<<"Podaj liczbe: ";
- cin>>x;
- silnia = 1;
- for(int i=1;x>=i;i++) {
- silnia=silnia*i;
- }
- cout<<"Silnia z "<<x<<" wynosi "<<silnia;
- return 0;
- }
- -------------------------------------------------------------------------------------
- #include <iostream>
- using namespace std;
- int main() {
- int i,tab1[20];
- for(int i=0; i<=19; i++) {
- cout<<"Podaj nr tablicy: ";
- cin>>tab1[i];
- }
- cout<<tab1[i];
- return 0;
- }
- -------------------------------------------------------------------------------------
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main() {
- int tab[100];
- srand( time( 0 ) );
- for(int i=0; i<100; i++) {
- tab[i]=rand()%10;
- cout<<tab[i]<<" ";
- }
- return 0;
- }
- -------------------------------------------------------------------------------------
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main() {
- int suma=0;
- int tab[100];
- srand( time( 0 ) );
- for(int i=0; i<100; i++) {
- tab[i]=rand()%6;
- suma=suma+tab[i];
- cout<<tab[i]<<" ";
- }
- cout<<"\n"<<"srednia jest rowna "<<suma/100;
- return 0;
- }
- -------------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment