Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<time.h>
- void verifica(int *x, int a[][10]){
- int i, j;
- for(i=0; i<10; i++){
- for(j=0; j<10; j++){
- if(a[i][j]==*x){
- *x = 1;
- }
- else if(a[i][j]!=*x){
- *x = 0;
- }
- }
- }
- }
- void Imprimirmatriz(int x[][10]){
- int i, j;
- for(i=0; i<10; i++){
- printf("\n");
- for(j=0; j<10; j++){
- printf("%d ", x[i][j]);
- }
- }
- }
- int sorteio(int x[][10]){
- int i, j;
- for(i=0; i<10; i++){
- for(j=0; j<10; j++){
- x[i][j]=rand()%10;
- }
- }
- return x[i][j];
- }
- int main(){
- int matriz[10][10]={};
- int x=0;
- srand(time(NULL));
- sorteio(matriz);
- Imprimirmatriz(matriz);
- printf("\n\n");
- scanf("%d", &x);
- verifica(&x, *matriz);
- printf("\n%d\n", x);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement