#include <stdio.h>
void func(int n){
//ここから
static int count = 0;
count++;
//ここまでを埋めてください
printf("%dは%d番目の素数\n", n
, count
); }
//引数nが素数かどうかの判定をします
//素数なら1を戻り値として返し,素数でなければ0を返します
int prime(int n){
int i;
int sosuu = 1;
for(i=2; i<n; i++){
if(n%i == 0){
sosuu=0;
break;
}
}
return sosuu;
}
int main(void) {
int x;
for(int i=2; i<20;i++){
x = prime(i);
if (x == 1){
func(i);
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CnZvaWQgZnVuYyhpbnQgbil7Ci8v44GT44GT44GL44KJCglzdGF0aWMgaW50IGNvdW50ID0gMDsKCWNvdW50Kys7Ci8v44GT44GT44G+44Gn44KS5Z+L44KB44Gm44GP44Gg44GV44GECiAgICBwcmludGYoIiVk44GvJWTnlarnm67jga7ntKDmlbBcbiIsIG4sIGNvdW50KTsKfQovL+W8leaVsG7jgYzntKDmlbDjgYvjganjgYbjgYvjga7liKTlrprjgpLjgZfjgb7jgZkKLy/ntKDmlbDjgarjgonvvJHjgpLmiLvjgorlgKTjgajjgZfjgabov5TjgZfvvIzntKDmlbDjgafjgarjgZHjgozjgbAw44KS6L+U44GX44G+44GZCmludCBwcmltZShpbnQgbil7CiAgICBpbnQgaTsKICAgIGludCBzb3N1dSA9IDE7CiAgICBmb3IoaT0yOyBpPG47IGkrKyl7CiAgICAgICAgaWYobiVpID09IDApeyAKICAgICAgICAgICBzb3N1dT0wOwogICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiBzb3N1dTsKfQoKaW50IG1haW4odm9pZCkgewogICAgaW50IHg7CiAgICBmb3IoaW50IGk9MjsgaTwyMDtpKyspewogICAgICAgIHggPSBwcmltZShpKTsKICAgIGlmICh4ID09IDEpewogICAgICAgIGZ1bmMoaSk7CiAgICB9Cn0KCXJldHVybiAwOwp9Cg==