Guest User

Untitled

a guest
Jan 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. long long isprime(long long a)
  5. {
  6. long long i;
  7. for(i=2;i<a;++i)
  8. {
  9. /*printf(" %d %d\n",a,a+i); /*проверка работы функции, зацикливается значениями 7,3342445*/
  10. if ((a % i) == 0){return 0;}
  11. }
  12. printf("something");
  13. return 1;
  14. }
  15.  
  16. int main(void)
  17. {
  18. int s=0;
  19. long long int n;
  20. scanf("%lld",&n); /*проверяю на единице*/
  21. for(++n;isprime(n)==0;++n)
  22. {
  23. printf("%lld+%d\n",n,s); /*если проверка функции закомментирована, выдает 2,3342445 3,3342445 ... 6,3342445.*/
  24. };
  25. printf("%lld",n);
  26. printf("still workS");
  27. return 0;
  28. }
Add Comment
Please, Sign In to add comment