7-2(隨機分數判測)
/***********
continue
break
**********/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(void)
{
int i=0, a;
srand(time(NULL));
printf("正修科大 40404113 郭怡勝\n");
while(1)
{
a = rand()% 101;
i++;
if (a < 60 && a > 6)
continue;
else
if(a >= 60)
{
printf("%d a=%d ",i, a);
printf(" 是及格的\n");
}
else
{
printf("%d a=%d ",i, a);
printf(" 呵呵 你分數好低 呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵呵\n");
break;
}
}
return 0;
}