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