Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include<time.h>
- #include<stdlib.h>
- #define R 5
- #define S 5
- #ifndef DEBUG
- #define DEBUG(...)printf(__VA_ARGS__)
- #endif
- int main(){
- int i, j, mat[R][S], polje[99]={};
- for(i=0; i<R; i++){
- for(j=0; j<S; j++){
- mat[i][j]=rand()%99 + 1;
- }
- }
- for(i=0; i<R; i++){
- for(j=0; j<S; j++){
- printf("%4d", mat[i][j]);
- }
- printf("\n");
- }
- for(i=0; i<R; i++){
- for(j=0; j<S; j++){
- polje[mat[i][j]]++;
- }
- }
- for(i=0; i<99; i++){
- if(polje[i])
- printf("%d -> %d\n", i, polje[i]);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment