Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int n;
- int arr[1000];
- printf("vvedite razmer massiva");
- scanf("%d", &n);
- printf("zapolnite massive");
- scanf("%d", &arr[0]);
- int max = arr[0], maxi = 0;
- for(int i = 1; i < n; i += 1) {
- scanf("%d", &arr[i]);
- if(arr[i] > max) {
- max = arr[i];
- maxi = i;
- }
- }
- for(int i = maxi; i < n-1; i += 1) {
- arr[i] = arr[i+1];
- }
- for(int i = 0; i < n - 1; i += 1) {
- printf("%d ", arr[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement