Untitled

mail@pastecode.io avatar
unknown
c_cpp
14 days ago
844 B
0
Indexable
Never
#include <iostream>

int main()
{
    int results[ 4 ];

    results[ 0 ] = 2 + 7 * 16 - 8;
    results[ 1 ] = 22 * 2 / 11;
    results[ 2 ] = 8383 - 222 + 292 * 8;
    results[ 3 ] = 5 * 2 * 4;

    std::cout << "Wyniki operacji:" << std::endl;
    for( int i = 0; i < 4; ++i )
    {
        std::cout << "Operacja " << ( i + 1 ) << ": " << results[ i ] << std::endl;
    }

    int results2[ 4 ];

    results2[ 0 ] = results[ 0 ] * 2 - 13;
    results2[ 1 ] = results[ 1 ] - 4 + 1;
    results2[ 2 ] = results[ 2 ] + 88 - 250;
    results2[ 3 ] = results[ 3 ] + results2[ 0 ] + results2[ 1 ] + results2[ 2 ];

    std::cout << "\nWyniki operacji:" << std::endl;
    for( int i = 0; i < 4; ++i )
    {
        std::cout << "Operacja " << ( i + 1 ) << ": " << results2[ i ] << std::endl;
    }

    return 0;
}
Leave a Comment