Ofelya1308
?>

вопрос - введиде маску для выбора всех файлов имя которых начинается с буквы z, а расширение заканчивается на букву а​

Информатика

Ответы

svetegal

include <stdio.h>

#include <stdlib.h>

#include <time.h>

#include <string.h>

const unsigned M=5;

 

void init_array(int A[][M], unsigned n);

void print_of_array(int A[][M], unsigned n);

void swap (int *pa, int *pb);

void changing_of_array(int A[][M], unsigned n);

int main(){

   const unsigned N=5;

       int A[N][M];

       init_array(A,N);

       print_of_array(A,N);

       printf("\n");

               printf("\n");

       changing_of_array(A,N);

       print_of_array(A,N);

       getchar();

       return 0;

   

}

 

void init_array(int A[][M], unsigned n){

   for (unsigned i=0; i<n; i++)

   for (unsigned j=0; j<M;j++)

   A[i][j]=rand()%100;

}

void print_of_array(int A[][M], unsigned n){

   for (unsigned i=0; i<n; i++){

   for (unsigned j=0; j<M;j++)

       printf("%5d", A[i][j]);

   printf("\n");}

}

void swap(int *pa, int *pb){

   int temp=*pa;

   *pa=*pb;

   *pb=temp;

   return;

                                     }

void changing_of_array(int A[][M], unsigned n)  {

   unsigned l=1;

   for (unsigned i=1; i<n; i++)              {

   for (unsigned j=M-1; j+1>0; j--){

       if ((j-l)<0) break;

   swap(&A[i][j],&A[i][j-l]);            }

l++;    

                                                            }

   

                                                                 }

Объяснение:

Ответить на вопрос

Поделитесь своими знаниями, ответьте на вопрос:

вопрос - введиде маску для выбора всех файлов имя которых начинается с буквы z, а расширение заканчивается на букву а​
Ваше имя (никнейм)*
Email*
Комментарий*

Популярные вопросы в разделе

YuREVICh646
alexeytikhonov
borisowaew
Solovetzmila
смирнов1127
tatyanakras911248
irinaphones8
supercom-ru-marinaguseva4267
Стуканова УЧРЕЖДЕНИЕ1877
okabankova7
restkof
vakhitov100961
ivanda
Tipan77
teashop
▲