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