Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Билет 18
- #include <iostream>
- #include <cmath>
- #include <math.h>
- int main ()
- {
- using namespace std;
- const int N = 5;
- const int M = N * 2;
- int A[N] = { -4, -2, 0, 9, 9 };
- int B[N] = { 1, 3, 6, 8, 10 };
- int arr[M];
- int i = 0, j = 0, k = 0;
- while (i < N && j < N)
- {
- if (A[i] < B[j])
- {
- arr[k] = A[i];
- i++;
- }
- else
- {
- arr[k] = B[j];
- j++;
- }
- k++;
- }
- for (; i < N; i++, k++)
- arr[k] = A[i];
- for (; j < N; j++, k++)
- arr[k] = B[j];
- for (int i = 0; i < M; i++)
- cout << arr[i] << " ";
- cout << endl;
- }
- #include <stdio.h>
- #include<math.h>
- int main()
- {
- int a = 590155069;
- int b, i = 0, k;
- b = a;
- while (b > 1) { // считает кол-во символов в числе
- b /= 10;
- i++;
- } i--;
- k = pow(10, i);
- while (k) {
- b = a / k;
- if (b != 5 && b != 0) printf("%d", b);
- a -= b * k;
- k /= 10;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement