Reginaldojs

exercicio 9,lista 5

Jul 30th, 2012
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<time.h>
  4. #define N 500
  5. int main(){
  6.     int i,j,faixa,m[N][N],l,c;
  7.     srand(time(NULL));
  8.     printf("Quantas linhas tera sua matriz?\n");
  9.     scanf("%d",&l);
  10.     printf("E,quantas colunas?\n");
  11.     scanf("%d",&c);
  12.     printf("Por favor,qual a faixa do sorteio?\n");
  13.     scanf("%d",&faixa);
  14.     printf("Pronto,ai esta sua matriz:\n");
  15.     for(i=0;i<l;i++){
  16.        printf("\n");
  17.         for(j=0;j<c;j++){
  18.            printf("  ");
  19.            m[i][j]=(rand()%faixa)+100;  
  20.            printf("%.0d",m[i][j]);
  21.         }
  22.      }
  23.      printf("\n\n\nbacana neh!!!\n\n\n");
  24.      system("pause");
  25.      return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment