Advertisement
scy1203

素数

Mar 26th, 2025
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include "stdio.h"
  2. void main (){
  3. int i,j;
  4. for ( i = 2; i <= 100; i++)
  5. {
  6. j = 2;
  7. while(j<=i/2){
  8. if(i%j == 0)
  9. break;
  10. else
  11. j++;
  12. }
  13. if(j>i/2)
  14. printf(" %d ",i);
  15. }
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement