Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <unistd.h>
- int kotaz(){
- return (int)(rand() / (RAND_MAX + 1.0) * 4.0 + 1.0);
- }
- int main() {
- int zarodek;
- time_t tt;
- zarodek = time(&tt);
- srand(zarodek); // za zarodek wstawiamy pobrany czas w sekundach
- int tab[10];
- int i,c=0,m;
- for(i=0;i<10;i+=1)
- {
- tab[i]=kotaz();
- printf("%d ",tab[i]);
- }
- for(i=0;i<10;i+=1)
- {
- if(tab[i]%4==0)
- if(tab[i]>c)
- c=tab[i];
- }
- printf("Najwieksza liczba to %d",c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement