that_one_nigga_you_k

maior sequencia decr

Jun 26th, 2023
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.86 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(){
  5.  
  6.     int testes;
  7.     int loop = 0;
  8.  
  9.     printf("digite a quantidade de testes: ");
  10.     scanf("%d", &testes);
  11.  
  12.     int sequencias [testes][100];
  13.     int tamanho [testes];
  14.  
  15.     while(loop<testes){
  16.  
  17.         printf("\ndigite o tamanho da sequencia %d: ", loop+1);
  18.         scanf("%d", &tamanho[loop]);
  19.  
  20.         for(int i = 0 ; i < tamanho[loop]; i++){
  21.             printf("\ndigite o valor %d do vetor %d: ", i+1 , loop+1);
  22.             scanf("%d", &sequencias[loop][i]);
  23.         }
  24.  
  25.  
  26.         loop++;
  27.     }
  28.  
  29.     loop = 0;
  30.  
  31.     printf("printando os vetores: ");
  32.  
  33.     while (loop < testes){
  34.  
  35.         printf("\nsequencia %d: ", loop+1);
  36.  
  37.         for(int i = 0 ; i < tamanho[loop] ; i++){
  38.             printf("%d, ", sequencias[loop][i]);
  39.         }
  40.  
  41.         loop++;
  42.     }
  43.    
  44.  
  45.    return(0);
  46.  
  47. }
Add Comment
Please, Sign In to add comment