Created
June 17, 2013 04:25
-
-
Save misodengaku/5794645 to your computer and use it in GitHub Desktop.
misod_000@miso-T430s ~
$ ./sosu
kazu=>1
1 is prime misod_000@miso-T430s ~
$ ./sosu
kazu=>1
1 is not prime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int main() | |
| { | |
| int i; | |
| srand((unsigned int)time(NULL)); | |
| printf("kazu=>"); | |
| scanf("%d", &i); | |
| if ((rand() % 2) == 1) | |
| printf("%d is prime\n", i); | |
| else | |
| printf("%d is not prime\n", i); | |
| return; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment