Results 1 to 6 of 6

Thread: .

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Jul:2011
    Location: Pavlikeni
    Posts: 48

    .

    ! . , . : , . , . . , , . , , - . :
    #include <iostream>
    #include <iomanip>
    using namespace std;

    int main()
    {
    const int M=3;
    const int N=3;
    int A[M][N];
    int B[M];
    int i,j,k;
    for(i=0;i<M;i++)
    for(j=0;j<N;j++)
    {
    cout<<"A["<<i+1<<"]["<<j+1<<"]= ";
    cin>>A[i][j];
    }
    for(i=0;i<M;i++)
    {
    B[k]=A[i];
    k++;
    }
    // izvejdane na vhodnite danni
    cout << "\n Vhoden masiv: \n";
    for (i=0; i<M; i++)
    cout << "A[" << i+1 << "]=" << A[i] << endl;
    cout<<"A[" <<j+1<< "]=" <<A[j]<<endl;
    // izvejdane na rezultato
    if (k==0) // Ako nqma nov masiv:
    cout << "\n Nqma chisla <0! \n";
    else
    {
    cout << "\n Nov masiv: \n";
    for (i=0; i<k; i++)
    cout << "B[" << i+1 << "]=" << B[i] << endl;
    }
    return 0; }

  2. #2
    Registered User badboybadboy's Avatar
    Join Date: Mar:2008
    Location: sofia
    Posts: 10,496
    . . ? .
    Last edited by badboybadboy; 11th December 2015 at 19:07.

  3. #3
    Registered User
    Join Date: Jan:2011
    Location:
    Posts: 306
    c++, c#, ,

    for(i=0;i<M;i++)
    {
    B[k]=A[i];
    k++;
    }

    ? A[i] , ? , , - , . , , , .
    Asrock Z370 Gaming K6 | i7-8700k | FD Celsius S24 | FD Define R5 | Corsair 2X8GB 3000Mhz |MSI GTX1080 Gaming |Samsung 960 Evo 512GB | Seagate 2TB | Corsair RM1000W | Acer xb271hu | Corsair K70 RGB KB |Logitech G900 mouse |Razer Vespula Pad |Arctis Pro Wireless HS

  4. #4
    Registered User georgi_dunchev's Avatar
    Join Date: Dec:2003
    Location:
    Posts: 486
    :
    1. ( {} ). - , .
    :
    for(..)
    for(..)
    {
    ..
    }
    :
    for(..)
    {
    for(..)
    {
    ..
    }
    }
    /Hidden:

    2. , , , . - .

    int i,j,k;
    for(i=0;i<M;i++)
    for(j=0;j<N;j++)
    {
    ..
    }
    for(i=0;i<M;i++)
    ..
    :
    for(int i=0;i<M;i++)
    for(int j=0;j<N;j++)
    {
    ..
    }
    for(int i=0;i<M;i++)
    ..
    /Hidden:

    3. 0, 1
    4. . , , , ..

    RVG , . .
    , , A, B. , .

  5. #5
    Registered User
    Join Date: Jul:2011
    Location: Pavlikeni
    Posts: 48
    ! . .

  6. #6
    Registered User
    Join Date: Jan:2011
    Location:
    Posts: 306
    , , .
    Asrock Z370 Gaming K6 | i7-8700k | FD Celsius S24 | FD Define R5 | Corsair 2X8GB 3000Mhz |MSI GTX1080 Gaming |Samsung 960 Evo 512GB | Seagate 2TB | Corsair RM1000W | Acer xb271hu | Corsair K70 RGB KB |Logitech G900 mouse |Razer Vespula Pad |Arctis Pro Wireless HS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |