Answer the question
In order to leave comments, you need to log in
Problem with Word 2013, top toolbar is constantly hidden
The problem is this:
The toolbar is constantly hidden up under the plate, after clicking on it it opens, but after clicking in the body of the document it leaves again. Word already reinstalled, the problem persists.
Answer the question
In order to leave comments, you need to log in
The third point is solved simply - you need to move the elements in the array: assign a[i]=a[i+1] in a loop.
I think you are not allowed to use STL, so write loops.
The format of this site forbids combining a bunch of questions into one, so try to separate the topics.
3) Remove element with number K.
void defuse( const int a[], int n ) {
int lim = n + n / 2,
d[ lim ],
t = lim - 1;
while( --n >= 0 ) {
d[ t-- ] = a[ n ];
if( n % 2 == 0 ) d[ t-- ] = 0;
}
for( int n = 0; n < lim; n++ )
cout << d[ n ] << ( n == lim - 1 ? "\n" : " " );
}
int main( int argc, char* argv[] ) {
const int N = atoi( argv[ 1 ] );
int arr[ N ];
for( int i = 0; i < N; i++ )
cout << ( arr[ i ] = i + 1 ) << ( i == N - 1 ? "\n" : " " );
defuse( arr, N );
}
$ ./narr 5
1 2 3 4 5
1 2 0 3 4 0 5
$ ./narr 6
1 2 3 4 5 6
0 1 2 0 3 4 0 5 6
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question