Áàçà çíàíèé ñòóäåíòà. Ðåôåðàò, êóðñîâàÿ, êîíòðîëüíàÿ, äèïëîì íà çàêàç

êóðñîâûå,êîíòðîëüíûå,äèïëîìû,ðåôåðàòû

Ïðîãðàììèðîâàíèå íà Ñ++ — Ïðîãðàììèðîâàíèå, Áàçû äàííûõ

  1. Äàíî n (n≤100) âåùåñòâåííûõ ÷èñåë. Îïðåäåëèòü, îáðàçóþò ëè îíè âîçðàñòàþùóþ ïîñëåäîâàòåëüíîñòü.

×òîáû ìàññèâ áûë ñòðîãî âîçðàñòàþùèì êàæäûé ïîñëåäóþùèé ýëåìåíò äîëæåí áûòü áîëüøå ïðåäûäóùåãî. ×òîáû ýòî ïðîâåðèòü îðãàíèçóåì öèêë îò ïåðâîãî äî ïðåäïîñëåäíåãî ýëåìåíòà.  öèêëå áóäåì ñðàâíèâàòü òåêóùèé ýëåìåíò ìàññèâà ñ ïîñëåäóþùèì. Åñëè âñòðå÷àåòñÿ ñèòóàöèÿ ïðè êîòîðîé ñëåäóþùèé ýëåìåíò ìåíüøå èëè ðàâåí òåêóùåìó ýëåìåíòó òî äåëàåì âûâîä ÷òî ìàññèâ íå ñòðîãî âîçðàñòàþùèé. Åñëè òàêîé ñèòóàöèè íå ïðîèçîøëî, äåëàåì âûâîä, ÷òî ìàññèâ ñòðîãî âîçðàñòàþùèé.

      ×èñëî ýëåìåíòîâ ìàññèâà 5.

Y[1]=1.1

Y[2]=2.8

Y[3]=4.5

Y[4]=6.7

Y[5]=6.75

Îòâåò: Ñòðîãî âîçðàñòàþùèé ìàññèâ


2.Ïðîâåðèòü, ïðàâèëüí ëè â çàäàííîì òåêñòå ðàññòàâëåíû êðóãëûå ñêîáêè ( ò.å. íàõîäèòñÿ ëè ñïðàâà îò êàæäîé îòêðûâàþùåé ñêîáêè ñîîòâåòñòâóþùàÿ åé çàêðûâàþùàÿ ñêîáêà, à ñëåâà îò êàæäîé çàêðûâàþùåé - ñîîòâåòñòâóþùàÿ åé çàêðûâàþùàÿ). Îòâåò – «ÄÀ» èëè «ÍÅÒ»

1.     Ââîäèì:

‘Ïðè ýòîì (êàê è ðàíåå) èñïîëüçóåòñÿ ïîçíà÷íûå ìîäåëè ðàññìàòðèâàåìûõ ïîñëåäîâàòåëüíîñòåé è àíàëîã ôîðìóëû (9) ’


Îòâåò:

Âåðíî

3. Çàäàí ìàññèâ èç 15 äåéñòâèòåëüíûõ ÷èñåë. Óïîðÿäî÷èòü åãî ïî íåóáûâàíèþ.

Ââîäèì                                                    Îòâåò

Y[1]=5                                                  Y[1]=0

Y[2]=34                                                Y[2]=1

 Y[3]=8                                                 Y[3]=2

Y[4]=21                                                Y[4]=2

Y[5]=0                                                  Y[5]=3

Y[6]=8                                                  Y[6]=4

Y[7]=3                                                  Y[7]=5

Y[8]=2                                                  Y[8]=6

Y[9]=1                                                  Y[9]=8

Y[10]=6                                                Y[10]=8

Y[11]=4                                                Y[11]=21

Y[12]=2                                                Y[12]=23

Y[13]= 43                                             Y[13]= 34


Y[14]= 23                                             Y[14]= 43

Y[15]= 45                                             Y[15]= 45

Îïèñàíèå ïåðåìåííûõ è èñõîäíûé òåêñò ê 1-ìó ïðèìåðó

#include                                                            

#include                                                           

#define M 100                      //ìàêñèìàëüíàÿ äëèíà ìàññèâà              

main()                                                                       

{                                                                            

  void    inpdim(float a[],int *n);//Ïðîöåäóðà ââîä  ìàññèâà                  

  float   y[M];                    //Ìàññèâ                                  

  int     n;                       //äëèíà ìàññèâà                           

  int     flag=0;                  //Ôëàã ñòðîãî âîçðàñòàþùåãî ìàññèâà: ñòðîãî

  int     i;                       //Ñ÷åò÷èê øàãîâ öèêëà                     

                                                                             

  inpdim(y,&n);                    //Ââîäèì ìàññèâ                           

  i = 0;                           //Îáíóëÿåì ñ÷åò÷èê                        

                                                                             

  do                               //Íà÷àëî öèêëà                            

  {                                                                           

    if (y[i] >= y[i+1])            //Åñëè i-ûé ýëåìåíò ìàññèâà >= i+1-ãî     

      flag = 1;                    //Ôëàã óñòàíàâëèâàåì 1(íå ñòðîãî âîçðàñòàåò)

    i++;                           //Óâåëè÷èâàåì ñ÷åò÷èê íà 1                

  }                                                                          

  while(flag == 0 && i < n-1);     //Åñëè Ôëàã íå ðàâåí 0 èëè i>= n-1 çàêàí÷èâàþ

  if (flag == 0)                                 //Åñëè Ôëàã ðàâåí 0

     printf("nÑòðîãî âîçðàñòàþùèé ìàññèân");   //Ñòðîãî âîçðàñòàþùèé ìàññèâ

  else                                           //Èíà÷å

     printf("nÌàññèâ íåñòðîãî âîçðàñòàþùèé n");//Ìàññèâ íåñòðîãî âîçðàñòàþùèé

  return(0);

}

void inpdim(float a[],int *n)

{

  int      i;

  do

  {

    printf("Ââåäèòå ÷èñëî ýëåìåíòîâ ìàññèâà (0

    scanf("%d",n);

    if ( *n >= M || *n <= 0 )

      {

        printf("Íåâåðíàÿ äëèíà ìàññèâà (0

      }

   }

  while ( *n >= M || *n <= 0 );

  printf("n Ââåäèòå ìàññèâ :n");

    scanf("%d",n);

    if ( *n >= M || *n <= 0 )

      {

        printf("Íåâåðíàÿ äëèíà ìàññèâà (0

      }

   }

  while ( *n >= M || *n <= 0 );

  printf("n Ââåäèòå ìàññèâ :n");

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

  {

     printf("Y[%d]=",i+1);

     scanf("%f",&a[i]);

  }

}

Îïèñàíèå ïåðåìåííûõ è èñõîäíûé òåêñò ê 2-ìó ïðèìåðó

#include

#include

#include

#define M 200                           //Ìàêñèàëüíàÿ äëèíà òåêñòà

main()

{

  void    inpstr(char a[]);             //Ââîä òåêñòà

  char    string[M];                    //Òåêñò

  int     i=0;                          //Ñ÷åò÷èêè øàãîâ öèêëîâ

  int     leftbracket=0,rightbracket=0; //Êîëè÷åñòâî ëåâûõ è ïðàâûõ ñêîáîê â òåêñòå

  int     flag=0;                       //Ôëàã âåðíî ïîñòàâëåííûõ ïðàâûõ ñêîáîê (âåðíî: 0 íåâåðíî:1)

  inpstr(string);                       //Ââîäèì òåêñò

  do                                   //Íà÷àëî öèêëà

  {

   if (string[i]=='(')                 //Åñëè i-ûé ñèìâîë òåêñòà = (

     leftbracket++;                    //Óâåëè÷èâàåì ñ÷åò÷èê ëåâûõ ñêîáîê íà 1

   if (string[i]==')')                 //Åñëè i-ûé ñèìâîë òåêñòà = (

   {

     rightbracket++;                   //Óâåëè÷èâàåì ñ÷åò÷èê ïðàâûõ ñêîáîê íà 1

  if (leftbracket

     flag=1;                          //Ïðàâûå ñêîáêè âûñòàâëåíû íåïðàâèëüíî Ôëàãó ïðèñâàèâàåì 1

 }                                                                        

    i++;                                //Óâåëè÷èâàåì ñ÷åò÷èê öèêëà íà 1    

   }                                                                          _

   while(i äëèíû ñòðîêè èëè Ôëàã = 1 çàêàí÷èâàåì öèêë//

   if (leftbracket==rightbracket && flag==0)  //Åñëè êîëè÷åñòâî ëåâûõ ñêîáîê ðàâíî êîëè÷åñòâó ïðàâûõ è ôëàã=0

    printf("n Âåðíî n");                   //Ñêîáêè ðàññòàâëåíû âåðíî     

    else                                       //Èíà÷å                        

    printf("n Íåâåðíî n");                 //Ñêîáêè ðàññòàâëåíû íåâåðíî   

   return(0);                                                                

}                                                                           

void inpstr(char a[])                                                       

{                                                                           

  int      i;                                                               

  printf("n Ââåäèòå ñòðîêó :n");                                           

  gets(a);                                                                  

 }           

        Îïèñàíèå ïåðåìåííûõ è èñõîäíûé òåêñò ê 3-ìó ïðèìåðó

         #include                                                             

#include                                                           

#define M 15              //äëèíà ìàññèâà                                    

main()                                                                       

{                                                                            

  void    inpdim(float a[]);//Ïðîöåäóðà ââîäà ìàññèâà                          

  void    outdim(àäùôå a[]);//Ïðîöåäóðà âûâîäà ìàññèâà                         

  float     y[M];           //Ìàññèâ                                           

  float    i,j;            //Ñ÷åò÷èêè øàãîâ öèêëîâ                            

  float    k;              //Äëÿ õðàíåíèÿ íîìåðà ìèíèìàëüíîãî ýëåìåíòà        

  float    n;              //Äëÿ õðàíåíèÿ ìèíèìàëüíîãî ýëåìåíòà               

                                                                             

  inpdim(y);              //Ââîäèì ìàññèâ                                    

                                                                              

  for(i=0; i

  {                                                                          

     n=y[i];              //çàïîìèíàåì ýëåìåíò êàê ìèíèìàëüíûé                

     k=i;                 //è åãî íîìåð êàê íîìåð ìèíèìàëüíîãî               

                                                                             

     for(j=i+1; j

     {                                                                       

     {                                                                       

        if (y[j] < n)     //Åñëè ýëåìåíò ìåíüøå ìèíèìàëüíîãî                 

        {                                                                     

           n=y[j];        //çàïîìèíàåì ýëåìåíò êàê ìèíèìàëüíûé               

           k=j;           //è åãî íîìåð êàê íîìåð ìèíèìàëüíîãî               

        }                                                                     

     }                                                                       

     y[k] = y[i];         //Íà ìåñòî ìèíèìàëüíîãî çàïèñûâàåì i-ûé ýëåìåíò    

     y[i] = n;            //Íà ìåñòî i-ãî çàïèñûâàåì ìèíèìàëüíûé ýëåìåíò     

  }                                                                          

  outdim(y);              //Âûâîäèì ìàññèâ                                   

  return(0);                                                                 

}                                                                             

void inpdim(float a[])                                                         

{                                                                            

  float      i;                                                                 

  printf("n Ââåäèòå ìàññèâ :n");                                           

  for ( i = 0 ; i < M ; i++)                                                 

  {                                                                           

     printf("Y[%f]=",i+1);                                              

     scanf("%f",&a[i]);                                                      

  }

}

void outdim(int a[])

{

  float      i;

  printf("n Óïîðÿäî÷åííûé ìàññèâ :n");

  for ( i = 0 ; i < M ; i++)

  {

     printf("Y[%f]=",i+1);

     printf("%f",a[i]);

     printf("n");

  }

}

                   Áëîê – ñõåìû ê ïðèìåðàì  (íà ñëåäóþùåé ñòðàíèöå)   

1.

ÊÎÍÅÖ

Âûâîä

‘Ìàññèâ  íå ñòðîãî âîçðàñòàþùèé’

Âûâîä

‘Ñòðîãî âîçðàñòàþùèé ìàññèâ’

äà

íåò

Åñëè

flag =0

Åñëè

i < n è flag=0

íåò

äà

i=i+1

íåò

äà

Åñëè

Y[i] >= Y[i+1]

=" Y[i+1] " v:shapes="_x0000_s1041">

i=0

flag=0

ÍÀ×ÀËÎ

Ââîä äëèíû ìàññèâà n,

Ââîä ìàññèâà Y



flag = 1


2.

äà

Âûâîä

‘Íåâåðíî’

Âûâîä

‘Âåðíî

Åñëè flag =0  è leftbracket = rightbracket

íåò

íåò

Åñëè

i

äà

i=i+1

íåò

äà

Åñëè

leftbracket < rightbracket

íåò

äà

rightbracket = rightbracket + 1

Åñëè

string [i] = ‘(’

flag=0

íåò

äà

leftbracket = leftbracket + 1

Åñëè

string [i] = ‘(’

i=0

Ââîä òåêñòà

string

ÍÀ×ÀËÎ



ÊÎÍÅÖ

                     

flag=0


3.     

íåò

j=j+1

j=k+1

M=15

Ââîä ìàññèâà Y

äà

k=i

äà

íåò

äà

n= y[i]

ÍÀ×ÀËÎ



i=0

Åñëè

i

Åñëè

y[j]

Âûâîä

ìàññèâà Y

ÊÎÍÅÖ

Åñëè

j

íåò

n=y[j]

k=j

y[k]=y[i]

y[i]=n

i=i+1


                                                                                                        

Ñîäåðæàíèå:

1.     Óñëîâèÿ çàäà÷ è îïèñàíèÿ ìåòîäîâ ðåøåíèÿ. Òåñòû äëÿ ïðîâåðêè ðàáîòîñïîñîáíîñòè ïðîãðàììû.

2.     Îïèñàíèÿ ïåðåìåííûõ è òåêñòû ïðîãðàìì. Ðåçóëüòàòû âûïîëíåíèÿ òåñòîâ.

3.     Áëîê – ñõåìû àëãîðèòìîâ ðåøåíèÿ çàäà÷.

Äàíî n (n&#8804;100) âåùåñòâåííûõ ÷èñåë. Îïðåäåëèòü, îáðàçóþò ëè îíè âîçðàñòàþùóþ ïîñëåäîâàòåëüíîñòü. ×òîáû ìàññèâ áûë ñòðîãî âîçðàñòàþùèì êàæäûé ïîñëåäóþùèé ýëåìåíò äîëæåí áûòü áîëüøå ïðåäûäóùåãî. ×òîáû ýòî ïðîâåðèòü îðãàíèçóåì öèêë îò ïåð

 

 

 

Âíèìàíèå! Ïðåäñòàâëåííàÿ Êóðñîâàÿ íàõîäèòñÿ â îòêðûòîì äîñòóïå â ñåòè Èíòåðíåò, è óæå íåîäíîêðàòíî ñäàâàëàñü, âîçìîæíî, äàæå â òâîåì ó÷åáíîì çàâåäåíèè.
Ñîâåòóåì íå ðèñêîâàòü. Óçíàé, ñêîëüêî ñòîèò àáñîëþòíî óíèêàëüíàÿ Êóðñîâàÿ ïî òâîåé òåìå:

Íîâîñòè îáðàçîâàíèÿ è íàóêè

Çàêàçàòü óíèêàëüíóþ ðàáîòó

Ïîõîæèå ðàáîòû:

Òåõíè÷åñêèé àíàëèç ðûíêà öåííûõ áóìàã íà ïðèìåðå àêöèé ÐÀÎ "ÅÝÑ Ðîññèÿ" 2001-2002 ãã.
Windows 98
Ðàçðàáîòêà ïðîåêòà ÈÂÑ äëÿ óïðàâëåíèÿ ôàéëîâûìè ðåñóðñàìè è ðåñóðñàìè ïå÷àòè â ñåòÿõ ïîä óïðàâëåíèåì Win2000
Ðàçðàáîòêà áàçû äàííûõ "Êóëüòóðíûé äîñóã"
Õåøèðîâàíèå
Ñòðóêòóðû äàííûõ: áèíàðíîå óïîðÿäî÷åííîå íåñáàëàíñèðîâàííîå äåðåâî
Òåõíè÷åñêèå ñðåäñòâà îáó÷åíèÿ
Ñðàâíèòåëüíûé àíàëèç ÿçûêîâ ïðîãðàììèðîâàíèÿ JavaScript è VBScript
Îïåðàöèè ìíîãîêðàòíîé òî÷íîñòè (îïåðàöèè ñ äëèííûìè ÷èñëàìè)
Ðàçðàáîòêà áàçû äàííûõ

Ñâîè ñäàííûå ñòóäåí÷åñêèå ðàáîòû

ïðèñûëàéòå íàì íà e-mail

Client@Stud-Baza.ru