SHARE
TWEET

Untitled

a guest Oct 21st, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <math.h>
  2. #include <stdio.h>
  3. #include <locale.h>
  4. #define _CRT_SECURE_NO_WARNINGS
  5. int main() {
  6. setlocale(0, "russian");
  7. int n, p;
  8. printf("Введите натуральное число N, не равное 1 \n");
  9. scanf_s("%d", &n);
  10. p = 2;
  11. printf("Введено число %d \n", n);
  12. printf("Разложение числа на простые множители: ");
  13. for (p = 2; n > 1; ++p) {
  14. if (n % p == 0) {
  15. while (n % p == 0) {
  16. n = n / p;
  17. printf("%d ", p);
  18. }
  19. }
  20. }
  21. 2
  22. return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top